<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "https://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml">
<head>
<meta http-equiv="Content-Type" content="text/xhtml;charset=UTF-8"/>
<meta http-equiv="X-UA-Compatible" content="IE=9"/>
<meta name="generator" content="Doxygen 1.8.17"/>
<meta name="viewport" content="width=device-width, initial-scale=1"/>
<title>Win32k: queue.c 源文件</title>
<link href="tabs.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="jquery.js"></script>
<script type="text/javascript" src="dynsections.js"></script>
<link href="navtree.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="resize.js"></script>
<script type="text/javascript" src="navtreedata.js"></script>
<script type="text/javascript" src="navtree.js"></script>
<link href="search/search.css" rel="stylesheet" type="text/css"/>
<script type="text/javascript" src="search/searchdata.js"></script>
<script type="text/javascript" src="search/search.js"></script>
<link href="doxygen.css" rel="stylesheet" type="text/css" />
</head>
<body>
<div id="top"><!-- do not remove this div, it is closed by doxygen! -->
<div id="titlearea">
<table cellspacing="0" cellpadding="0">
 <tbody>
 <tr style="height: 56px;">
  <td id="projectalign" style="padding-left: 0.5em;">
   <div id="projectname">Win32k
   </div>
  </td>
 </tr>
 </tbody>
</table>
</div>
<!-- end header part -->
<!-- 制作者 Doxygen 1.8.17 -->
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
var searchBox = new SearchBox("searchBox", "search",false,'搜索');
/* @license-end */
</script>
<script type="text/javascript" src="menudata.js"></script>
<script type="text/javascript" src="menu.js"></script>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(function() {
  initMenu('',true,false,'search.php','搜索');
  $(document).ready(function() { init_search(); });
});
/* @license-end */</script>
<div id="main-nav"></div>
</div><!-- top -->
<div id="side-nav" class="ui-resizable side-nav-resizable">
  <div id="nav-tree">
    <div id="nav-tree-contents">
      <div id="nav-sync" class="sync"></div>
    </div>
  </div>
  <div id="splitbar" style="-moz-user-select:none;" 
       class="ui-resizable-handle">
  </div>
</div>
<script type="text/javascript">
/* @license magnet:?xt=urn:btih:cf05388f2679ee054f2beb29a391d25f4e673ac3&amp;dn=gpl-2.0.txt GPL-v2 */
$(document).ready(function(){initNavTree('a00824_source.html',''); initResizable(); });
/* @license-end */
</script>
<div id="doc-content">
<!-- window showing the filter options -->
<div id="MSearchSelectWindow"
     onmouseover="return searchBox.OnSearchSelectShow()"
     onmouseout="return searchBox.OnSearchSelectHide()"
     onkeydown="return searchBox.OnSearchSelectKey(event)">
</div>

<!-- iframe showing the search results (closed by default) -->
<div id="MSearchResultsWindow">
<iframe src="javascript:void(0)" frameborder="0" 
        name="MSearchResults" id="MSearchResults">
</iframe>
</div>

<div class="header">
  <div class="headertitle">
<div class="title">queue.c</div>  </div>
</div><!--header-->
<div class="contents">
<a href="a00824.html">浏览该文件的文档.</a><div class="fragment"><div class="line"><a name="l00001"></a><span class="lineno">    1</span>&#160; </div>
<div class="line"><a name="l00013"></a><span class="lineno">   13</span>&#160;<span class="preprocessor">#include &quot;<a class="code" href="a03629.html">precomp.h</a>&quot;</span></div>
<div class="line"><a name="l00014"></a><span class="lineno">   14</span>&#160;<span class="preprocessor">#pragma hdrstop</span></div>
<div class="line"><a name="l00015"></a><span class="lineno">   15</span>&#160; </div>
<div class="line"><a name="l00016"></a><span class="lineno">   16</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#a625f273e3c887a8cf38f78db6d144bca">ProcessUpdateKeyStateEvent</a>(<a class="code" href="a02869.html">PQ</a> pq, PBYTE pbKeyState);</div>
<div class="line"><a name="l00017"></a><span class="lineno">   17</span>&#160;VOID <a class="code" href="a00824.html#ae06ed5fecef73835af8f31f5ae4d9b21">DestroyProcessesObjects</a>(<a class="code" href="a02905.html">PPROCESSINFO</a> ppi);</div>
<div class="line"><a name="l00018"></a><span class="lineno">   18</span>&#160;VOID <a class="code" href="a00824.html#aed60a33fa725810e80dd0579a0cf4830">DestroyThreadsMessages</a>(<a class="code" href="a02869.html">PQ</a> pq, <a class="code" href="a02889.html">PTHREADINFO</a> pti);</div>
<div class="line"><a name="l00019"></a><span class="lineno">   19</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#acbf7182e6530b750eed27ef83e03c85f">CheckProcessForeground</a>(<a class="code" href="a02889.html">PTHREADINFO</a> pti);</div>
<div class="line"><a name="l00020"></a><span class="lineno">   20</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#a85b93c8ee73cb5dc4eb0e7b3221a454a">ScreenSaverCheck</a>(<a class="code" href="a02889.html">PTHREADINFO</a> pti);</div>
<div class="line"><a name="l00021"></a><span class="lineno">   21</span>&#160;<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> <a class="code" href="a00824.html#a042c33a03ceecdea69466cb1d0e916e7">xxxPollAndWaitForSingleObject</a>(PKEVENT pEvent, PVOID pExecObject,</div>
<div class="line"><a name="l00022"></a><span class="lineno">   22</span>&#160;        <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwMilliseconds);</div>
<div class="line"><a name="l00023"></a><span class="lineno">   23</span>&#160; </div>
<div class="line"><a name="l00024"></a><span class="lineno">   24</span>&#160;NTSTATUS <a class="code" href="a00824.html#a3c0d1abafc858da62fb0fd6777a0d6aa">InitiateShutdown</a>(<a class="code" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a> Thread, PULONG lpdwFlags);</div>
<div class="line"><a name="l00025"></a><span class="lineno">   25</span>&#160;NTSTATUS <a class="code" href="a00824.html#a5d94d9104c2ddbb9a459114768e7ffb3">EndShutdown</a>(<a class="code" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a> Thread, NTSTATUS StatusShutdown);</div>
<div class="line"><a name="l00026"></a><span class="lineno">   26</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#a317b5986c94a0fe6aec5cd38123cf2a3">SetVDMCursorBounds</a>(LPRECT lprc);</div>
<div class="line"><a name="l00027"></a><span class="lineno">   27</span>&#160; </div>
<div class="line"><a name="l00028"></a><span class="lineno"><a class="line" href="a00824.html#ada8a7fdcaa372258461349002764851c">   28</a></span>&#160;PW32PROCESS <a class="code" href="a00824.html#ada8a7fdcaa372258461349002764851c">gpwpCalcFirst</a> = NULL;</div>
<div class="line"><a name="l00029"></a><span class="lineno">   29</span>&#160; </div>
<div class="line"><a name="l00030"></a><span class="lineno">   30</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00031"></a><span class="lineno">   31</span>&#160;<span class="preprocessor">#define MSG_SENT    0</span></div>
<div class="line"><a name="l00032"></a><span class="lineno">   32</span>&#160;<span class="preprocessor">#define MSG_POST    1</span></div>
<div class="line"><a name="l00033"></a><span class="lineno">   33</span>&#160;<span class="preprocessor">#define MSG_RECV    2</span></div>
<div class="line"><a name="l00034"></a><span class="lineno">   34</span>&#160;<span class="preprocessor">#define MSG_PEEK    3</span></div>
<div class="line"><a name="l00035"></a><span class="lineno">   35</span>&#160;VOID <a class="code" href="a00824.html#aa8ea52319ca33f5f02b7813e98b5dc40">TraceDdeMsg</a>(<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> msg, HWND hwndFrom, HWND hwndTo, <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> code);</div>
<div class="line"><a name="l00036"></a><span class="lineno">   36</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00037"></a><span class="lineno"><a class="line" href="a00824.html#aa8ea52319ca33f5f02b7813e98b5dc40">   37</a></span>&#160;<span class="preprocessor">#define TraceDdeMsg(m, h1, h2, c)</span></div>
<div class="line"><a name="l00038"></a><span class="lineno">   38</span>&#160;<span class="preprocessor">#endif // DEBUG</span></div>
<div class="line"><a name="l00039"></a><span class="lineno">   39</span>&#160; </div>
<div class="line"><a name="l00040"></a><span class="lineno"><a class="line" href="a00824.html#afb5d4ad1a9187731f8d009e2edf71ef4">   40</a></span>&#160;PVOID <a class="code" href="a00824.html#afb5d4ad1a9187731f8d009e2edf71ef4">QEntryLookasideBase</a>;</div>
<div class="line"><a name="l00041"></a><span class="lineno"><a class="line" href="a00824.html#a08b7806fdd50cc30030d391686fbce53">   41</a></span>&#160;PVOID <a class="code" href="a00824.html#a08b7806fdd50cc30030d391686fbce53">QEntryLookasideBounds</a>;</div>
<div class="line"><a name="l00042"></a><span class="lineno"><a class="line" href="a00824.html#acca9241955afe10b5ed2fba6048ed484">   42</a></span>&#160;ZONE_HEADER <a class="code" href="a00824.html#acca9241955afe10b5ed2fba6048ed484">QEntryLookasideZone</a>;</div>
<div class="line"><a name="l00043"></a><span class="lineno">   43</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l00044"></a><span class="lineno">   44</span>&#160;ULONG AllocQEntryHiWater;</div>
<div class="line"><a name="l00045"></a><span class="lineno">   45</span>&#160;ULONG AllocQEntryCalls;</div>
<div class="line"><a name="l00046"></a><span class="lineno">   46</span>&#160;ULONG AllocQEntrySlowCalls;</div>
<div class="line"><a name="l00047"></a><span class="lineno">   47</span>&#160;ULONG DelQEntryCalls;</div>
<div class="line"><a name="l00048"></a><span class="lineno">   48</span>&#160;ULONG DelQEntrySlowCalls;</div>
<div class="line"><a name="l00049"></a><span class="lineno">   49</span>&#160;<span class="preprocessor">#endif // DBG</span></div>
<div class="line"><a name="l00050"></a><span class="lineno">   50</span>&#160; </div>
<div class="line"><a name="l00051"></a><span class="lineno"><a class="line" href="a00824.html#a1310cfa8277987ec1f39ab190577eb4c">   51</a></span>&#160;<span class="preprocessor">#define QUEUE_ENTRIES 16</span></div>
<div class="line"><a name="l00052"></a><span class="lineno"><a class="line" href="a00824.html#a5f4680255099c975e7786c45b1124304">   52</a></span>&#160;<a class="code" href="a02869.html">PQ</a> <a class="code" href="a00824.html#a5f4680255099c975e7786c45b1124304">QueueFreeList</a>[<a class="code" href="a00824.html#a1310cfa8277987ec1f39ab190577eb4c">QUEUE_ENTRIES</a>];</div>
<div class="line"><a name="l00053"></a><span class="lineno">   53</span>&#160; </div>
<div class="line"><a name="l00054"></a><span class="lineno">   54</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00055"></a><span class="lineno">   55</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">DebugValidateMLIST</a>(<a class="code" href="a02865.html">PMLIST</a> pml)</div>
<div class="line"><a name="l00056"></a><span class="lineno">   56</span>&#160;{</div>
<div class="line"><a name="l00057"></a><span class="lineno">   57</span>&#160;    <span class="keywordtype">int</span>     <a class="code" href="a00566.html#aefdbe49968222157e86f468e4563f083">c</a>;</div>
<div class="line"><a name="l00058"></a><span class="lineno">   58</span>&#160;    <a class="code" href="a02857.html">PQMSG</a>   pqmsg;</div>
<div class="line"><a name="l00059"></a><span class="lineno">   59</span>&#160; </div>
<div class="line"><a name="l00060"></a><span class="lineno">   60</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00061"></a><span class="lineno">   61</span>&#160;<span class="comment">     * Check that the message list is properly terminated.</span></div>
<div class="line"><a name="l00062"></a><span class="lineno">   62</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00063"></a><span class="lineno">   63</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(!pml-&gt;<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a> || !pml-&gt;<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>-&gt;<a class="code" href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">pqmsgPrev</a>);</div>
<div class="line"><a name="l00064"></a><span class="lineno">   64</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(!pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a> || !pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a>-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a>);</div>
<div class="line"><a name="l00065"></a><span class="lineno">   65</span>&#160; </div>
<div class="line"><a name="l00066"></a><span class="lineno">   66</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00067"></a><span class="lineno">   67</span>&#160;<span class="comment">     * Check that there aren&#39;t loops in the Next list.</span></div>
<div class="line"><a name="l00068"></a><span class="lineno">   68</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00069"></a><span class="lineno">   69</span>&#160;    <a class="code" href="a00566.html#aefdbe49968222157e86f468e4563f083">c</a> = pml-&gt;<a class="code" href="a02865.html#adcf976c068271034e6e569ce3109eb07">cMsgs</a>;</div>
<div class="line"><a name="l00070"></a><span class="lineno">   70</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(<a class="code" href="a00566.html#aefdbe49968222157e86f468e4563f083">c</a> &gt;= 0);</div>
<div class="line"><a name="l00071"></a><span class="lineno">   71</span>&#160;    pqmsg = pml-&gt;<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>;</div>
<div class="line"><a name="l00072"></a><span class="lineno">   72</span>&#160;    <span class="keywordflow">while</span> (--<a class="code" href="a00566.html#aefdbe49968222157e86f468e4563f083">c</a> &gt;= 0) {</div>
<div class="line"><a name="l00073"></a><span class="lineno">   73</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pqmsg);</div>
<div class="line"><a name="l00074"></a><span class="lineno">   74</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="a00566.html#aefdbe49968222157e86f468e4563f083">c</a> == 0) {</div>
<div class="line"><a name="l00075"></a><span class="lineno">   75</span>&#160;            <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pqmsg == pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a>);</div>
<div class="line"><a name="l00076"></a><span class="lineno">   76</span>&#160;        }</div>
<div class="line"><a name="l00077"></a><span class="lineno">   77</span>&#160; </div>
<div class="line"><a name="l00078"></a><span class="lineno">   78</span>&#160;        pqmsg = pqmsg-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a>;</div>
<div class="line"><a name="l00079"></a><span class="lineno">   79</span>&#160;    }</div>
<div class="line"><a name="l00080"></a><span class="lineno">   80</span>&#160; </div>
<div class="line"><a name="l00081"></a><span class="lineno">   81</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(!pqmsg);</div>
<div class="line"><a name="l00082"></a><span class="lineno">   82</span>&#160; </div>
<div class="line"><a name="l00083"></a><span class="lineno">   83</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00084"></a><span class="lineno">   84</span>&#160;<span class="comment">     * Check that there aren&#39;t loops in the Prev list.</span></div>
<div class="line"><a name="l00085"></a><span class="lineno">   85</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00086"></a><span class="lineno">   86</span>&#160;    <a class="code" href="a00566.html#aefdbe49968222157e86f468e4563f083">c</a> = pml-&gt;<a class="code" href="a02865.html#adcf976c068271034e6e569ce3109eb07">cMsgs</a>;</div>
<div class="line"><a name="l00087"></a><span class="lineno">   87</span>&#160;    pqmsg = pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a>;</div>
<div class="line"><a name="l00088"></a><span class="lineno">   88</span>&#160;    <span class="keywordflow">while</span> (--<a class="code" href="a00566.html#aefdbe49968222157e86f468e4563f083">c</a> &gt;= 0) {</div>
<div class="line"><a name="l00089"></a><span class="lineno">   89</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pqmsg);</div>
<div class="line"><a name="l00090"></a><span class="lineno">   90</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="a00566.html#aefdbe49968222157e86f468e4563f083">c</a> == 0) {</div>
<div class="line"><a name="l00091"></a><span class="lineno">   91</span>&#160;            <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pqmsg == pml-&gt;<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>);</div>
<div class="line"><a name="l00092"></a><span class="lineno">   92</span>&#160;        }</div>
<div class="line"><a name="l00093"></a><span class="lineno">   93</span>&#160; </div>
<div class="line"><a name="l00094"></a><span class="lineno">   94</span>&#160;        pqmsg = pqmsg-&gt;<a class="code" href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">pqmsgPrev</a>;</div>
<div class="line"><a name="l00095"></a><span class="lineno">   95</span>&#160;    }</div>
<div class="line"><a name="l00096"></a><span class="lineno">   96</span>&#160; </div>
<div class="line"><a name="l00097"></a><span class="lineno">   97</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(!pqmsg);</div>
<div class="line"><a name="l00098"></a><span class="lineno">   98</span>&#160;}</div>
<div class="line"><a name="l00099"></a><span class="lineno">   99</span>&#160; </div>
<div class="line"><a name="l00100"></a><span class="lineno">  100</span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#a089b1ee79d56a4319e4ec556c2d20423">DebugValidateMLISTandQMSG</a>(<a class="code" href="a02865.html">PMLIST</a> pml, <a class="code" href="a02857.html">PQMSG</a> pqmsg)</div>
<div class="line"><a name="l00101"></a><span class="lineno">  101</span>&#160;{</div>
<div class="line"><a name="l00102"></a><span class="lineno">  102</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsgT;</div>
<div class="line"><a name="l00103"></a><span class="lineno">  103</span>&#160; </div>
<div class="line"><a name="l00104"></a><span class="lineno">  104</span>&#160;    <a class="code" href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">DebugValidateMLIST</a>(pml);</div>
<div class="line"><a name="l00105"></a><span class="lineno">  105</span>&#160;    <span class="keywordflow">for</span> (pqmsgT = pml-&gt;<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>; pqmsgT; pqmsgT = pqmsgT-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a>) {</div>
<div class="line"><a name="l00106"></a><span class="lineno">  106</span>&#160;        <span class="keywordflow">if</span> (pqmsgT == pqmsg) {</div>
<div class="line"><a name="l00107"></a><span class="lineno">  107</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00108"></a><span class="lineno">  108</span>&#160;        }</div>
<div class="line"><a name="l00109"></a><span class="lineno">  109</span>&#160;    }</div>
<div class="line"><a name="l00110"></a><span class="lineno">  110</span>&#160; </div>
<div class="line"><a name="l00111"></a><span class="lineno">  111</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pqmsgT == pqmsg);</div>
<div class="line"><a name="l00112"></a><span class="lineno">  112</span>&#160;}</div>
<div class="line"><a name="l00113"></a><span class="lineno">  113</span>&#160; </div>
<div class="line"><a name="l00114"></a><span class="lineno">  114</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00115"></a><span class="lineno"><a class="line" href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">  115</a></span>&#160;<span class="preprocessor">#define DebugValidateMLIST(pml)</span></div>
<div class="line"><a name="l00116"></a><span class="lineno"><a class="line" href="a00824.html#a089b1ee79d56a4319e4ec556c2d20423">  116</a></span>&#160;<span class="preprocessor">#define DebugValidateMLISTandQMSG(pml, pqmsg)</span></div>
<div class="line"><a name="l00117"></a><span class="lineno">  117</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00118"></a><span class="lineno">  118</span>&#160; </div>
<div class="line"><a name="l00119"></a><span class="lineno">  119</span>&#160; </div>
<div class="line"><a name="l00128"></a><span class="lineno"><a class="line" href="a00824.html#a494493f4db0cfc2a67d2e21d05ba4584">  128</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#a494493f4db0cfc2a67d2e21d05ba4584">xxxSetProcessInitState</a>(</div>
<div class="line"><a name="l00129"></a><span class="lineno">  129</span>&#160;    PEPROCESS Process,</div>
<div class="line"><a name="l00130"></a><span class="lineno">  130</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwFlags)</div>
<div class="line"><a name="l00131"></a><span class="lineno">  131</span>&#160;{</div>
<div class="line"><a name="l00132"></a><span class="lineno">  132</span>&#160;    PW32PROCESS W32Process;</div>
<div class="line"><a name="l00133"></a><span class="lineno">  133</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l00134"></a><span class="lineno">  134</span>&#160; </div>
<div class="line"><a name="l00135"></a><span class="lineno">  135</span>&#160;    CheckCritIn();</div>
<div class="line"><a name="l00136"></a><span class="lineno">  136</span>&#160; </div>
<div class="line"><a name="l00137"></a><span class="lineno">  137</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00138"></a><span class="lineno">  138</span>&#160;<span class="comment">     * If the W32Process structure has not been allocated, do it now.</span></div>
<div class="line"><a name="l00139"></a><span class="lineno">  139</span>&#160;<span class="comment">     * Leave the Process field NULL so the kernel will know to do</span></div>
<div class="line"><a name="l00140"></a><span class="lineno">  140</span>&#160;<span class="comment">     * a callout if the process ever calls Win32k</span></div>
<div class="line"><a name="l00141"></a><span class="lineno">  141</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00142"></a><span class="lineno">  142</span>&#160;    W32Process = (PW32PROCESS)Process-&gt;Win32Process;</div>
<div class="line"><a name="l00143"></a><span class="lineno">  143</span>&#160;    if (W32Process == NULL) {</div>
<div class="line"><a name="l00144"></a><span class="lineno">  144</span>&#160;        <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l00145"></a><span class="lineno">  145</span>&#160;        Status = PsCreateWin32Process(Process);</div>
<div class="line"><a name="l00146"></a><span class="lineno">  146</span>&#160;        <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l00147"></a><span class="lineno">  147</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l00148"></a><span class="lineno">  148</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00149"></a><span class="lineno">  149</span>&#160;        W32Process = (PW32PROCESS)Process-&gt;Win32Process;</div>
<div class="line"><a name="l00150"></a><span class="lineno">  150</span>&#160; </div>
<div class="line"><a name="l00151"></a><span class="lineno">  151</span>&#160;        if (W32Process == NULL) {</div>
<div class="line"><a name="l00152"></a><span class="lineno">  152</span>&#160;            <a class="code" href="a00371.html#a31aafffb49dfe98bdc749c9b35c90162">RIPMSG1</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;xxxSetProcessInitState: Process %lX died from under us&quot;</span>, Process);</div>
<div class="line"><a name="l00153"></a><span class="lineno">  153</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00154"></a><span class="lineno">  154</span>&#160;        }</div>
<div class="line"><a name="l00155"></a><span class="lineno">  155</span>&#160;    }</div>
<div class="line"><a name="l00156"></a><span class="lineno">  156</span>&#160; </div>
<div class="line"><a name="l00157"></a><span class="lineno">  157</span>&#160;    <span class="keywordflow">if</span> (dwFlags == 0) {</div>
<div class="line"><a name="l00158"></a><span class="lineno">  158</span>&#160;        <span class="keywordflow">if</span> (!(W32Process-&gt;W32PF_Flags &amp; W32PF_WOW)) {</div>
<div class="line"><a name="l00159"></a><span class="lineno">  159</span>&#160; </div>
<div class="line"><a name="l00160"></a><span class="lineno">  160</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00161"></a><span class="lineno">  161</span>&#160;<span class="comment">             * Check to see if the startglass is on, and if so turn it off and update.</span></div>
<div class="line"><a name="l00162"></a><span class="lineno">  162</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00163"></a><span class="lineno">  163</span>&#160;            <span class="keywordflow">if</span> (W32Process-&gt;W32PF_Flags &amp; W32PF_STARTGLASS) {</div>
<div class="line"><a name="l00164"></a><span class="lineno">  164</span>&#160;                W32Process-&gt;W32PF_Flags &amp;= ~W32PF_STARTGLASS;</div>
<div class="line"><a name="l00165"></a><span class="lineno">  165</span>&#160;                <a class="code" href="a00824.html#a38b809c615e10eca863b213d461e7040">CalcStartCursorHide</a>(NULL, 0);</div>
<div class="line"><a name="l00166"></a><span class="lineno">  166</span>&#160;            }</div>
<div class="line"><a name="l00167"></a><span class="lineno">  167</span>&#160; </div>
<div class="line"><a name="l00168"></a><span class="lineno">  168</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00169"></a><span class="lineno">  169</span>&#160;<span class="comment">             * Found it.  Set the console bit and reset the wait event so any sleepers</span></div>
<div class="line"><a name="l00170"></a><span class="lineno">  170</span>&#160;<span class="comment">             * wake up.</span></div>
<div class="line"><a name="l00171"></a><span class="lineno">  171</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00172"></a><span class="lineno">  172</span>&#160;            W32Process-&gt;W32PF_Flags |= W32PF_CONSOLEAPPLICATION;</div>
<div class="line"><a name="l00173"></a><span class="lineno">  173</span>&#160;            SET_PSEUDO_EVENT(&amp;W32Process-&gt;InputIdleEvent);</div>
<div class="line"><a name="l00174"></a><span class="lineno">  174</span>&#160;        }</div>
<div class="line"><a name="l00175"></a><span class="lineno">  175</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (!(W32Process-&gt;W32PF_Flags &amp; W32PF_INITIALIZED)) {</div>
<div class="line"><a name="l00176"></a><span class="lineno">  176</span>&#160;        W32Process-&gt;W32PF_Flags |= W32PF_INITIALIZED;</div>
<div class="line"><a name="l00177"></a><span class="lineno">  177</span>&#160; </div>
<div class="line"><a name="l00178"></a><span class="lineno">  178</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00179"></a><span class="lineno">  179</span>&#160;<span class="comment">         * Set global state to allow the new process to become</span></div>
<div class="line"><a name="l00180"></a><span class="lineno">  180</span>&#160;<span class="comment">         * foreground.  InitProcessInfo() will set</span></div>
<div class="line"><a name="l00181"></a><span class="lineno">  181</span>&#160;<span class="comment">         * W32PF_ALLOWFOREGROUNDACTIVATE when the process initializes.</span></div>
<div class="line"><a name="l00182"></a><span class="lineno">  182</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00183"></a><span class="lineno">  183</span>&#160;        <a class="code" href="a03257.html#acdbf053b054e159961f2ba3d6e577bfc">gfAllowForegroundActivate</a> = TRUE;</div>
<div class="line"><a name="l00184"></a><span class="lineno">  184</span>&#160; </div>
<div class="line"><a name="l00185"></a><span class="lineno">  185</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00186"></a><span class="lineno">  186</span>&#160;<span class="comment">         * If this is the win32 server process, force off start glass feedback</span></div>
<div class="line"><a name="l00187"></a><span class="lineno">  187</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00188"></a><span class="lineno">  188</span>&#160;        <span class="keywordflow">if</span> (Process == <a class="code" href="a03257.html#a3eabb6cc6d3b24f411b7f94f5d6edac6">gpepCSRSS</a>) {</div>
<div class="line"><a name="l00189"></a><span class="lineno">  189</span>&#160;            dwFlags |= STARTF_FORCEOFFFEEDBACK;</div>
<div class="line"><a name="l00190"></a><span class="lineno">  190</span>&#160;        }</div>
<div class="line"><a name="l00191"></a><span class="lineno">  191</span>&#160; </div>
<div class="line"><a name="l00192"></a><span class="lineno">  192</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00193"></a><span class="lineno">  193</span>&#160;<span class="comment">         * Show the app start cursor for 2 seconds if it was requested from</span></div>
<div class="line"><a name="l00194"></a><span class="lineno">  194</span>&#160;<span class="comment">         * the application.</span></div>
<div class="line"><a name="l00195"></a><span class="lineno">  195</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00196"></a><span class="lineno">  196</span>&#160;        <span class="keywordflow">if</span> (dwFlags &amp; STARTF_FORCEOFFFEEDBACK) {</div>
<div class="line"><a name="l00197"></a><span class="lineno">  197</span>&#160;            W32Process-&gt;W32PF_Flags |= W32PF_FORCEOFFFEEDBACK;</div>
<div class="line"><a name="l00198"></a><span class="lineno">  198</span>&#160;            <a class="code" href="a00824.html#a38b809c615e10eca863b213d461e7040">CalcStartCursorHide</a>(NULL, 0);</div>
<div class="line"><a name="l00199"></a><span class="lineno">  199</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dwFlags &amp; STARTF_FORCEONFEEDBACK) {</div>
<div class="line"><a name="l00200"></a><span class="lineno">  200</span>&#160;            <a class="code" href="a00824.html#a38b809c615e10eca863b213d461e7040">CalcStartCursorHide</a>(W32Process, 2000);</div>
<div class="line"><a name="l00201"></a><span class="lineno">  201</span>&#160;        }</div>
<div class="line"><a name="l00202"></a><span class="lineno">  202</span>&#160;    }</div>
<div class="line"><a name="l00203"></a><span class="lineno">  203</span>&#160;}</div>
<div class="line"><a name="l00204"></a><span class="lineno">  204</span>&#160; </div>
<div class="line"><a name="l00205"></a><span class="lineno">  205</span>&#160; </div>
<div class="line"><a name="l00216"></a><span class="lineno"><a class="line" href="a00824.html#a507668fdd19718f6de8825719bf23632">  216</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#a507668fdd19718f6de8825719bf23632">UserNotifyConsoleApplication</a>(</div>
<div class="line"><a name="l00217"></a><span class="lineno">  217</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> idProcess)</div>
<div class="line"><a name="l00218"></a><span class="lineno">  218</span>&#160;{</div>
<div class="line"><a name="l00219"></a><span class="lineno">  219</span>&#160;    NTSTATUS  Status;</div>
<div class="line"><a name="l00220"></a><span class="lineno">  220</span>&#160;    PEPROCESS Process;</div>
<div class="line"><a name="l00221"></a><span class="lineno">  221</span>&#160; </div>
<div class="line"><a name="l00222"></a><span class="lineno">  222</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00223"></a><span class="lineno">  223</span>&#160;<span class="comment">     * First search for this process in our process information list.</span></div>
<div class="line"><a name="l00224"></a><span class="lineno">  224</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00225"></a><span class="lineno">  225</span>&#160;    <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l00226"></a><span class="lineno">  226</span>&#160;    Status = LockProcessByClientId((HANDLE)idProcess, &amp;Process);</div>
<div class="line"><a name="l00227"></a><span class="lineno">  227</span>&#160;    <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l00228"></a><span class="lineno">  228</span>&#160; </div>
<div class="line"><a name="l00229"></a><span class="lineno">  229</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00230"></a><span class="lineno">  230</span>&#160;        <a class="code" href="a00371.html#a906cb0845450a5d5422ce513ecd8a32f">RIPMSG2</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;UserNotifyConsoleApplication: Failed with Process ID == %X, Status = %x\n&quot;</span>,</div>
<div class="line"><a name="l00231"></a><span class="lineno">  231</span>&#160;                idProcess, Status);</div>
<div class="line"><a name="l00232"></a><span class="lineno">  232</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00233"></a><span class="lineno">  233</span>&#160;    }</div>
<div class="line"><a name="l00234"></a><span class="lineno">  234</span>&#160; </div>
<div class="line"><a name="l00235"></a><span class="lineno">  235</span>&#160;    <a class="code" href="a00824.html#a494493f4db0cfc2a67d2e21d05ba4584">xxxSetProcessInitState</a>(Process, 0);</div>
<div class="line"><a name="l00236"></a><span class="lineno">  236</span>&#160; </div>
<div class="line"><a name="l00237"></a><span class="lineno">  237</span>&#160;    UnlockProcess(Process);</div>
<div class="line"><a name="l00238"></a><span class="lineno">  238</span>&#160;}</div>
<div class="line"><a name="l00239"></a><span class="lineno">  239</span>&#160; </div>
<div class="line"><a name="l00240"></a><span class="lineno">  240</span>&#160; </div>
<div class="line"><a name="l00241"></a><span class="lineno">  241</span>&#160; </div>
<div class="line"><a name="l00251"></a><span class="lineno"><a class="line" href="a00824.html#aa91fe5efc8921eb5856bfe012972c2b3">  251</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#aa91fe5efc8921eb5856bfe012972c2b3">UserSetConsoleProcessWindowStation</a>(</div>
<div class="line"><a name="l00252"></a><span class="lineno">  252</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> idProcess,</div>
<div class="line"><a name="l00253"></a><span class="lineno">  253</span>&#160;    HWINSTA hwinsta</div>
<div class="line"><a name="l00254"></a><span class="lineno">  254</span>&#160;    )</div>
<div class="line"><a name="l00255"></a><span class="lineno">  255</span>&#160;{</div>
<div class="line"><a name="l00256"></a><span class="lineno">  256</span>&#160;    NTSTATUS  Status;</div>
<div class="line"><a name="l00257"></a><span class="lineno">  257</span>&#160;    PEPROCESS Process;</div>
<div class="line"><a name="l00258"></a><span class="lineno">  258</span>&#160; </div>
<div class="line"><a name="l00259"></a><span class="lineno">  259</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00260"></a><span class="lineno">  260</span>&#160;<span class="comment">     * First search for this process in our process information list.</span></div>
<div class="line"><a name="l00261"></a><span class="lineno">  261</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00262"></a><span class="lineno">  262</span>&#160;    <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l00263"></a><span class="lineno">  263</span>&#160;    Status = LockProcessByClientId((HANDLE)idProcess, &amp;Process);</div>
<div class="line"><a name="l00264"></a><span class="lineno">  264</span>&#160;    <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l00265"></a><span class="lineno">  265</span>&#160; </div>
<div class="line"><a name="l00266"></a><span class="lineno">  266</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00267"></a><span class="lineno">  267</span>&#160;        <a class="code" href="a00371.html#a906cb0845450a5d5422ce513ecd8a32f">RIPMSG2</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;UserSetConsoleProcessWindowStation: Failed with Process ID == %X, Status = %x\n&quot;</span>,</div>
<div class="line"><a name="l00268"></a><span class="lineno">  268</span>&#160;                idProcess, Status);</div>
<div class="line"><a name="l00269"></a><span class="lineno">  269</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00270"></a><span class="lineno">  270</span>&#160;    }</div>
<div class="line"><a name="l00271"></a><span class="lineno">  271</span>&#160; </div>
<div class="line"><a name="l00272"></a><span class="lineno">  272</span>&#160;    Process-&gt;Win32WindowStation = hwinsta;</div>
<div class="line"><a name="l00273"></a><span class="lineno">  273</span>&#160; </div>
<div class="line"><a name="l00274"></a><span class="lineno">  274</span>&#160;    UnlockProcess(Process);</div>
<div class="line"><a name="l00275"></a><span class="lineno">  275</span>&#160;}</div>
<div class="line"><a name="l00276"></a><span class="lineno">  276</span>&#160; </div>
<div class="line"><a name="l00277"></a><span class="lineno">  277</span>&#160; </div>
<div class="line"><a name="l00278"></a><span class="lineno">  278</span>&#160; </div>
<div class="line"><a name="l00292"></a><span class="lineno"><a class="line" href="a00824.html#af4268805cc7bd4c71ad6d661e7a73b61">  292</a></span>&#160;BOOL <a class="code" href="a00824.html#af4268805cc7bd4c71ad6d661e7a73b61">UserNotifyProcessCreate</a>(</div>
<div class="line"><a name="l00293"></a><span class="lineno">  293</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> idProcess,</div>
<div class="line"><a name="l00294"></a><span class="lineno">  294</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> idParentThread,</div>
<div class="line"><a name="l00295"></a><span class="lineno">  295</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwData,</div>
<div class="line"><a name="l00296"></a><span class="lineno">  296</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwFlags)</div>
<div class="line"><a name="l00297"></a><span class="lineno">  297</span>&#160;{</div>
<div class="line"><a name="l00298"></a><span class="lineno">  298</span>&#160;    PEPROCESS Process;</div>
<div class="line"><a name="l00299"></a><span class="lineno">  299</span>&#160;    <a class="code" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a> Thread;</div>
<div class="line"><a name="l00300"></a><span class="lineno">  300</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l00301"></a><span class="lineno">  301</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l00302"></a><span class="lineno">  302</span>&#160; </div>
<div class="line"><a name="l00303"></a><span class="lineno">  303</span>&#160;    CheckCritIn();</div>
<div class="line"><a name="l00304"></a><span class="lineno">  304</span>&#160; </div>
<div class="line"><a name="l00305"></a><span class="lineno">  305</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00306"></a><span class="lineno">  306</span>&#160;<span class="comment">     * 0x1 bit means give feedback (app start cursor).</span></div>
<div class="line"><a name="l00307"></a><span class="lineno">  307</span>&#160;<span class="comment">     * 0x2 bit means this is a gui app (meaning, call CreateProcessInfo()</span></div>
<div class="line"><a name="l00308"></a><span class="lineno">  308</span>&#160;<span class="comment">     *     so we get app start synchronization (WaitForInputIdle()).</span></div>
<div class="line"><a name="l00309"></a><span class="lineno">  309</span>&#160;<span class="comment">     * 0x8 bit means this process is a WOW process, set W32PF_WOW.  0x1</span></div>
<div class="line"><a name="l00310"></a><span class="lineno">  310</span>&#160;<span class="comment">     *     and 0x2 bits will also be set.</span></div>
<div class="line"><a name="l00311"></a><span class="lineno">  311</span>&#160;<span class="comment">     * 0x4 value means this is really a shared WOW task starting</span></div>
<div class="line"><a name="l00312"></a><span class="lineno">  312</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00313"></a><span class="lineno">  313</span>&#160; </div>
<div class="line"><a name="l00314"></a><span class="lineno">  314</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00315"></a><span class="lineno">  315</span>&#160;<span class="comment">     * If we want feedback, we need to create a process info structure,</span></div>
<div class="line"><a name="l00316"></a><span class="lineno">  316</span>&#160;<span class="comment">     * so do it: it will be properly cleaned up.</span></div>
<div class="line"><a name="l00317"></a><span class="lineno">  317</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00318"></a><span class="lineno">  318</span>&#160;    <span class="keywordflow">if</span> ((dwFlags &amp; 0xb) != 0) {</div>
<div class="line"><a name="l00319"></a><span class="lineno">  319</span>&#160;        <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l00320"></a><span class="lineno">  320</span>&#160;        Status = LockProcessByClientId((HANDLE)idProcess, &amp;Process);</div>
<div class="line"><a name="l00321"></a><span class="lineno">  321</span>&#160;        <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l00322"></a><span class="lineno">  322</span>&#160; </div>
<div class="line"><a name="l00323"></a><span class="lineno">  323</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00324"></a><span class="lineno">  324</span>&#160;            <a class="code" href="a00371.html#a906cb0845450a5d5422ce513ecd8a32f">RIPMSG2</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;UserNotifyProcessCreate: Failed with Process ID == %X, Status = %x\n&quot;</span>,</div>
<div class="line"><a name="l00325"></a><span class="lineno">  325</span>&#160;                    idProcess, Status);</div>
<div class="line"><a name="l00326"></a><span class="lineno">  326</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00327"></a><span class="lineno">  327</span>&#160;        }</div>
<div class="line"><a name="l00328"></a><span class="lineno">  328</span>&#160; </div>
<div class="line"><a name="l00329"></a><span class="lineno">  329</span>&#160;        <a class="code" href="a00824.html#a494493f4db0cfc2a67d2e21d05ba4584">xxxSetProcessInitState</a>(Process, ((dwFlags &amp; 1) ?</div>
<div class="line"><a name="l00330"></a><span class="lineno">  330</span>&#160;                STARTF_FORCEONFEEDBACK : STARTF_FORCEOFFFEEDBACK));</div>
<div class="line"><a name="l00331"></a><span class="lineno">  331</span>&#160;        <span class="keywordflow">if</span> (dwFlags &amp; 0x8) {</div>
<div class="line"><a name="l00332"></a><span class="lineno">  332</span>&#160;            <span class="keywordflow">if</span> (Process-&gt;Win32Process)</div>
<div class="line"><a name="l00333"></a><span class="lineno">  333</span>&#160;                ((PW32PROCESS)Process-&gt;Win32Process)-&gt;W32PF_Flags |= W32PF_WOW;</div>
<div class="line"><a name="l00334"></a><span class="lineno">  334</span>&#160;        }</div>
<div class="line"><a name="l00335"></a><span class="lineno">  335</span>&#160;        UnlockProcess(Process);</div>
<div class="line"><a name="l00336"></a><span class="lineno">  336</span>&#160; </div>
<div class="line"><a name="l00337"></a><span class="lineno">  337</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00338"></a><span class="lineno">  338</span>&#160;<span class="comment">         * Find out who is starting this app. If it is a 16 bit app, allow</span></div>
<div class="line"><a name="l00339"></a><span class="lineno">  339</span>&#160;<span class="comment">         * it to bring itself back to the foreground if it calls</span></div>
<div class="line"><a name="l00340"></a><span class="lineno">  340</span>&#160;<span class="comment">         * SetActiveWindow() or SetFocus(). This is because this could be</span></div>
<div class="line"><a name="l00341"></a><span class="lineno">  341</span>&#160;<span class="comment">         * related to OLE to DDE activation. Notes has a case where after it</span></div>
<div class="line"><a name="l00342"></a><span class="lineno">  342</span>&#160;<span class="comment">         * lauches pbrush to edit an embedded bitmap, it brings up a message</span></div>
<div class="line"><a name="l00343"></a><span class="lineno">  343</span>&#160;<span class="comment">         * box on top if the bitmap is read only. This message box won&#39;t appear</span></div>
<div class="line"><a name="l00344"></a><span class="lineno">  344</span>&#160;<span class="comment">         * foreground unless we allow it to. This usually isn&#39;t a problem</span></div>
<div class="line"><a name="l00345"></a><span class="lineno">  345</span>&#160;<span class="comment">         * because most apps don&#39;t bring up windows on top of editors</span></div>
<div class="line"><a name="l00346"></a><span class="lineno">  346</span>&#160;<span class="comment">         * like this. 32 bit apps will call SetForegroundWindow().</span></div>
<div class="line"><a name="l00347"></a><span class="lineno">  347</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00348"></a><span class="lineno">  348</span>&#160; </div>
<div class="line"><a name="l00349"></a><span class="lineno">  349</span>&#160;        <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l00350"></a><span class="lineno">  350</span>&#160;        Status = LockThreadByClientId((HANDLE)idParentThread, &amp;Thread);</div>
<div class="line"><a name="l00351"></a><span class="lineno">  351</span>&#160;        <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l00352"></a><span class="lineno">  352</span>&#160; </div>
<div class="line"><a name="l00353"></a><span class="lineno">  353</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00354"></a><span class="lineno">  354</span>&#160;            <a class="code" href="a00371.html#a906cb0845450a5d5422ce513ecd8a32f">RIPMSG2</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;UserNotifyProcessCreate: Failed with Thread ID == %X, Status = %x\n&quot;</span>,</div>
<div class="line"><a name="l00355"></a><span class="lineno">  355</span>&#160;                    idParentThread, Status);</div>
<div class="line"><a name="l00356"></a><span class="lineno">  356</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00357"></a><span class="lineno">  357</span>&#160;        }</div>
<div class="line"><a name="l00358"></a><span class="lineno">  358</span>&#160; </div>
<div class="line"><a name="l00359"></a><span class="lineno">  359</span>&#160;        pti = PtiFromThread(Thread);</div>
<div class="line"><a name="l00360"></a><span class="lineno">  360</span>&#160;        <span class="keywordflow">if</span> (pti &amp;&amp; (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT)) {</div>
<div class="line"><a name="l00361"></a><span class="lineno">  361</span>&#160;            pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> |= TIF_ALLOWFOREGROUNDACTIVATE;</div>
<div class="line"><a name="l00362"></a><span class="lineno">  362</span>&#160;        }</div>
<div class="line"><a name="l00363"></a><span class="lineno">  363</span>&#160; </div>
<div class="line"><a name="l00364"></a><span class="lineno">  364</span>&#160;        UnlockThread(Thread);</div>
<div class="line"><a name="l00365"></a><span class="lineno">  365</span>&#160; </div>
<div class="line"><a name="l00366"></a><span class="lineno">  366</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (dwFlags == 4) {</div>
<div class="line"><a name="l00367"></a><span class="lineno">  367</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00368"></a><span class="lineno">  368</span>&#160;<span class="comment">         * A WOW task is starting up. Create the WOW per thread info</span></div>
<div class="line"><a name="l00369"></a><span class="lineno">  369</span>&#160;<span class="comment">         * structure here in case someone calls WaitForInputIdle</span></div>
<div class="line"><a name="l00370"></a><span class="lineno">  370</span>&#160;<span class="comment">         * before the thread is created.</span></div>
<div class="line"><a name="l00371"></a><span class="lineno">  371</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00372"></a><span class="lineno">  372</span>&#160;        <a class="code" href="a02877.html">PWOWTHREADINFO</a> pwti;</div>
<div class="line"><a name="l00373"></a><span class="lineno">  373</span>&#160; </div>
<div class="line"><a name="l00374"></a><span class="lineno">  374</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00375"></a><span class="lineno">  375</span>&#160;<span class="comment">         * Look for a matching thread in the WOW thread info list.</span></div>
<div class="line"><a name="l00376"></a><span class="lineno">  376</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00377"></a><span class="lineno">  377</span>&#160;        <span class="keywordflow">for</span> (pwti = <a class="code" href="a03257.html#a7a841563d95fb37851ffe2fd252b4384">gpwtiFirst</a>; pwti != NULL; pwti = pwti-&gt;<a class="code" href="a02877.html#acdfce03ff716b350b5b599cfd8717b3a">pwtiNext</a>) {</div>
<div class="line"><a name="l00378"></a><span class="lineno">  378</span>&#160;            <span class="keywordflow">if</span> (pwti-&gt;<a class="code" href="a02877.html#aa366686f75ba96749398a5607305e2e3">idTask</a> == idProcess) {</div>
<div class="line"><a name="l00379"></a><span class="lineno">  379</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00380"></a><span class="lineno">  380</span>&#160;            }</div>
<div class="line"><a name="l00381"></a><span class="lineno">  381</span>&#160;        }</div>
<div class="line"><a name="l00382"></a><span class="lineno">  382</span>&#160; </div>
<div class="line"><a name="l00383"></a><span class="lineno">  383</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00384"></a><span class="lineno">  384</span>&#160;<span class="comment">         * If we didn&#39;t find one, allocate a new one and add it to</span></div>
<div class="line"><a name="l00385"></a><span class="lineno">  385</span>&#160;<span class="comment">         * the head of the list.</span></div>
<div class="line"><a name="l00386"></a><span class="lineno">  386</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00387"></a><span class="lineno">  387</span>&#160;        <span class="keywordflow">if</span> (pwti == NULL) {</div>
<div class="line"><a name="l00388"></a><span class="lineno">  388</span>&#160;            pwti = (<a class="code" href="a00899.html#ad4e381baf70be5194cad4fa801e36b80">PWOWTHREADINFO</a>)UserAllocPoolWithQuota(</div>
<div class="line"><a name="l00389"></a><span class="lineno">  389</span>&#160;                    <span class="keyword">sizeof</span>(<a class="code" href="a02877.html">WOWTHREADINFO</a>), TAG_THREADINFO);</div>
<div class="line"><a name="l00390"></a><span class="lineno">  390</span>&#160;            <span class="keywordflow">if</span> (pwti == NULL) {</div>
<div class="line"><a name="l00391"></a><span class="lineno">  391</span>&#160;                <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l00392"></a><span class="lineno">  392</span>&#160;                <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00393"></a><span class="lineno">  393</span>&#160;            }</div>
<div class="line"><a name="l00394"></a><span class="lineno">  394</span>&#160;            INIT_PSEUDO_EVENT(&amp;pwti-&gt;<a class="code" href="a02877.html#afb9b6a62420feb835630dae9263ba014">pIdleEvent</a>);</div>
<div class="line"><a name="l00395"></a><span class="lineno">  395</span>&#160;            pwti-&gt;<a class="code" href="a02877.html#aa366686f75ba96749398a5607305e2e3">idTask</a> = idProcess;</div>
<div class="line"><a name="l00396"></a><span class="lineno">  396</span>&#160;            pwti-&gt;<a class="code" href="a02877.html#acdfce03ff716b350b5b599cfd8717b3a">pwtiNext</a> = <a class="code" href="a03257.html#a7a841563d95fb37851ffe2fd252b4384">gpwtiFirst</a>;</div>
<div class="line"><a name="l00397"></a><span class="lineno">  397</span>&#160;            <a class="code" href="a03257.html#a7a841563d95fb37851ffe2fd252b4384">gpwtiFirst</a> = pwti;</div>
<div class="line"><a name="l00398"></a><span class="lineno">  398</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00399"></a><span class="lineno">  399</span>&#160;            RESET_PSEUDO_EVENT(&amp;pwti-&gt;<a class="code" href="a02877.html#afb9b6a62420feb835630dae9263ba014">pIdleEvent</a>);</div>
<div class="line"><a name="l00400"></a><span class="lineno">  400</span>&#160;        }</div>
<div class="line"><a name="l00401"></a><span class="lineno">  401</span>&#160; </div>
<div class="line"><a name="l00402"></a><span class="lineno">  402</span>&#160;        pwti-&gt;<a class="code" href="a02877.html#a6484bfbbd54183683e5c1547f9836377">idWaitObject</a> = dwData;</div>
<div class="line"><a name="l00403"></a><span class="lineno">  403</span>&#160;        <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l00404"></a><span class="lineno">  404</span>&#160;        Status = LockThreadByClientId((HANDLE)idParentThread, &amp;Thread);</div>
<div class="line"><a name="l00405"></a><span class="lineno">  405</span>&#160;        <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l00406"></a><span class="lineno">  406</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l00407"></a><span class="lineno">  407</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00408"></a><span class="lineno">  408</span>&#160; </div>
<div class="line"><a name="l00409"></a><span class="lineno">  409</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l00410"></a><span class="lineno">  410</span>&#160;            <a class="code" href="a00371.html#a906cb0845450a5d5422ce513ecd8a32f">RIPMSG2</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;UserNotifyProcessCreate: Failed with Thread ID == %X, Status = %x\n&quot;</span>,</div>
<div class="line"><a name="l00411"></a><span class="lineno">  411</span>&#160;                    idParentThread, Status);</div>
<div class="line"><a name="l00412"></a><span class="lineno">  412</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l00413"></a><span class="lineno">  413</span>&#160;        }</div>
<div class="line"><a name="l00414"></a><span class="lineno">  414</span>&#160; </div>
<div class="line"><a name="l00415"></a><span class="lineno">  415</span>&#160;        pwti-&gt;<a class="code" href="a02877.html#ad05024704e7271fbf8b5f26ccb1770fa">idParentProcess</a> = (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)Thread-&gt;Cid.UniqueProcess;</div>
<div class="line"><a name="l00416"></a><span class="lineno">  416</span>&#160;        UnlockThread(Thread);</div>
<div class="line"><a name="l00417"></a><span class="lineno">  417</span>&#160;    }</div>
<div class="line"><a name="l00418"></a><span class="lineno">  418</span>&#160; </div>
<div class="line"><a name="l00419"></a><span class="lineno">  419</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l00420"></a><span class="lineno">  420</span>&#160;}</div>
<div class="line"><a name="l00421"></a><span class="lineno">  421</span>&#160; </div>
<div class="line"><a name="l00422"></a><span class="lineno">  422</span>&#160; </div>
<div class="line"><a name="l00423"></a><span class="lineno">  423</span>&#160; </div>
<div class="line"><a name="l00431"></a><span class="lineno"><a class="line" href="a00899.html#a5240fc3efe111669c90c35da4e7c4cba">  431</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#a38b809c615e10eca863b213d461e7040">CalcStartCursorHide</a>(</div>
<div class="line"><a name="l00432"></a><span class="lineno">  432</span>&#160;    PW32PROCESS pwp,</div>
<div class="line"><a name="l00433"></a><span class="lineno">  433</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> timeAdd)</div>
<div class="line"><a name="l00434"></a><span class="lineno">  434</span>&#160;{</div>
<div class="line"><a name="l00435"></a><span class="lineno">  435</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> timeNow;</div>
<div class="line"><a name="l00436"></a><span class="lineno">  436</span>&#160;    PW32PROCESS pwpT;</div>
<div class="line"><a name="l00437"></a><span class="lineno">  437</span>&#160;    PW32PROCESS *ppwpT;</div>
<div class="line"><a name="l00438"></a><span class="lineno">  438</span>&#160; </div>
<div class="line"><a name="l00439"></a><span class="lineno">  439</span>&#160;    timeNow = NtGetTickCount();</div>
<div class="line"><a name="l00440"></a><span class="lineno">  440</span>&#160; </div>
<div class="line"><a name="l00441"></a><span class="lineno">  441</span>&#160;    <span class="keywordflow">if</span> (pwp != NULL) {</div>
<div class="line"><a name="l00442"></a><span class="lineno">  442</span>&#160; </div>
<div class="line"><a name="l00443"></a><span class="lineno">  443</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00444"></a><span class="lineno">  444</span>&#160;<span class="comment">         * We were passed in a timeout. Recalculate when we timeout</span></div>
<div class="line"><a name="l00445"></a><span class="lineno">  445</span>&#160;<span class="comment">         * and add the pwp to the starting list.</span></div>
<div class="line"><a name="l00446"></a><span class="lineno">  446</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00447"></a><span class="lineno">  447</span>&#160;        <span class="keywordflow">if</span> (!(pwp-&gt;W32PF_Flags &amp; W32PF_STARTGLASS)) {</div>
<div class="line"><a name="l00448"></a><span class="lineno">  448</span>&#160; </div>
<div class="line"><a name="l00449"></a><span class="lineno">  449</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00450"></a><span class="lineno">  450</span>&#160;<span class="comment">             * Add it to the list only if it is not already in the list</span></div>
<div class="line"><a name="l00451"></a><span class="lineno">  451</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00452"></a><span class="lineno">  452</span>&#160;            <span class="keywordflow">for</span> (pwpT = <a class="code" href="a00824.html#ada8a7fdcaa372258461349002764851c">gpwpCalcFirst</a>; pwpT != NULL; pwpT = pwpT-&gt;NextStart) {</div>
<div class="line"><a name="l00453"></a><span class="lineno">  453</span>&#160;                <span class="keywordflow">if</span> (pwpT == pwp)</div>
<div class="line"><a name="l00454"></a><span class="lineno">  454</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00455"></a><span class="lineno">  455</span>&#160;            }</div>
<div class="line"><a name="l00456"></a><span class="lineno">  456</span>&#160; </div>
<div class="line"><a name="l00457"></a><span class="lineno">  457</span>&#160;            <span class="keywordflow">if</span> (pwpT != pwp) {</div>
<div class="line"><a name="l00458"></a><span class="lineno">  458</span>&#160;                pwp-&gt;NextStart = <a class="code" href="a00824.html#ada8a7fdcaa372258461349002764851c">gpwpCalcFirst</a>;</div>
<div class="line"><a name="l00459"></a><span class="lineno">  459</span>&#160;                <a class="code" href="a00824.html#ada8a7fdcaa372258461349002764851c">gpwpCalcFirst</a> = pwp;</div>
<div class="line"><a name="l00460"></a><span class="lineno">  460</span>&#160;            }</div>
<div class="line"><a name="l00461"></a><span class="lineno">  461</span>&#160;        }</div>
<div class="line"><a name="l00462"></a><span class="lineno">  462</span>&#160;        pwp-&gt;StartCursorHideTime = timeAdd + timeNow;</div>
<div class="line"><a name="l00463"></a><span class="lineno">  463</span>&#160;        pwp-&gt;W32PF_Flags |= W32PF_STARTGLASS;</div>
<div class="line"><a name="l00464"></a><span class="lineno">  464</span>&#160;    }</div>
<div class="line"><a name="l00465"></a><span class="lineno">  465</span>&#160; </div>
<div class="line"><a name="l00466"></a><span class="lineno">  466</span>&#160;    <a class="code" href="a03257.html#a601e8e85876cb79a58cf5cc3a717236d">gtimeStartCursorHide</a> = 0;</div>
<div class="line"><a name="l00467"></a><span class="lineno">  467</span>&#160;    <span class="keywordflow">for</span> (ppwpT = &amp;<a class="code" href="a00824.html#ada8a7fdcaa372258461349002764851c">gpwpCalcFirst</a>; (pwpT = *ppwpT) != NULL; ) {</div>
<div class="line"><a name="l00468"></a><span class="lineno">  468</span>&#160; </div>
<div class="line"><a name="l00469"></a><span class="lineno">  469</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00470"></a><span class="lineno">  470</span>&#160;<span class="comment">         * If the app isn&#39;t starting or feedback is forced off, remove</span></div>
<div class="line"><a name="l00471"></a><span class="lineno">  471</span>&#160;<span class="comment">         * it from the list so we don&#39;t look at it again.</span></div>
<div class="line"><a name="l00472"></a><span class="lineno">  472</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00473"></a><span class="lineno">  473</span>&#160;        <span class="keywordflow">if</span> (!(pwpT-&gt;W32PF_Flags &amp; W32PF_STARTGLASS) ||</div>
<div class="line"><a name="l00474"></a><span class="lineno">  474</span>&#160;                (pwpT-&gt;W32PF_Flags &amp; W32PF_FORCEOFFFEEDBACK)) {</div>
<div class="line"><a name="l00475"></a><span class="lineno">  475</span>&#160;            *ppwpT = pwpT-&gt;NextStart;</div>
<div class="line"><a name="l00476"></a><span class="lineno">  476</span>&#160;            <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00477"></a><span class="lineno">  477</span>&#160;        }</div>
<div class="line"><a name="l00478"></a><span class="lineno">  478</span>&#160; </div>
<div class="line"><a name="l00479"></a><span class="lineno">  479</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00480"></a><span class="lineno">  480</span>&#160;<span class="comment">         * Find the greatest hide cursor timeout value.</span></div>
<div class="line"><a name="l00481"></a><span class="lineno">  481</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00482"></a><span class="lineno">  482</span>&#160;        <span class="keywordflow">if</span> (gtimeStartCursorHide &lt; pwpT-&gt;StartCursorHideTime)</div>
<div class="line"><a name="l00483"></a><span class="lineno">  483</span>&#160;            <a class="code" href="a03257.html#a601e8e85876cb79a58cf5cc3a717236d">gtimeStartCursorHide</a> = pwpT-&gt;StartCursorHideTime;</div>
<div class="line"><a name="l00484"></a><span class="lineno">  484</span>&#160; </div>
<div class="line"><a name="l00485"></a><span class="lineno">  485</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00486"></a><span class="lineno">  486</span>&#160;<span class="comment">         * If this app has timed out, it isn&#39;t starting anymore!</span></div>
<div class="line"><a name="l00487"></a><span class="lineno">  487</span>&#160;<span class="comment">         * Remove it from the list.</span></div>
<div class="line"><a name="l00488"></a><span class="lineno">  488</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00489"></a><span class="lineno">  489</span>&#160;        <span class="keywordflow">if</span> (pwpT-&gt;StartCursorHideTime &lt;= timeNow) {</div>
<div class="line"><a name="l00490"></a><span class="lineno">  490</span>&#160;            pwpT-&gt;W32PF_Flags &amp;= ~W32PF_STARTGLASS;</div>
<div class="line"><a name="l00491"></a><span class="lineno">  491</span>&#160;            *ppwpT = pwpT-&gt;NextStart;</div>
<div class="line"><a name="l00492"></a><span class="lineno">  492</span>&#160;            <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l00493"></a><span class="lineno">  493</span>&#160;        }</div>
<div class="line"><a name="l00494"></a><span class="lineno">  494</span>&#160; </div>
<div class="line"><a name="l00495"></a><span class="lineno">  495</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00496"></a><span class="lineno">  496</span>&#160;<span class="comment">         * Step to the next pwp in the list.</span></div>
<div class="line"><a name="l00497"></a><span class="lineno">  497</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00498"></a><span class="lineno">  498</span>&#160;        ppwpT = &amp;pwpT-&gt;NextStart;</div>
<div class="line"><a name="l00499"></a><span class="lineno">  499</span>&#160;    }</div>
<div class="line"><a name="l00500"></a><span class="lineno">  500</span>&#160; </div>
<div class="line"><a name="l00501"></a><span class="lineno">  501</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00502"></a><span class="lineno">  502</span>&#160;<span class="comment">     * If the hide time is still less than the current time, then turn off</span></div>
<div class="line"><a name="l00503"></a><span class="lineno">  503</span>&#160;<span class="comment">     * the app starting cursor.</span></div>
<div class="line"><a name="l00504"></a><span class="lineno">  504</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00505"></a><span class="lineno">  505</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a601e8e85876cb79a58cf5cc3a717236d">gtimeStartCursorHide</a> &lt;= timeNow)</div>
<div class="line"><a name="l00506"></a><span class="lineno">  506</span>&#160;        <a class="code" href="a03257.html#a601e8e85876cb79a58cf5cc3a717236d">gtimeStartCursorHide</a> = 0;</div>
<div class="line"><a name="l00507"></a><span class="lineno">  507</span>&#160; </div>
<div class="line"><a name="l00508"></a><span class="lineno">  508</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00509"></a><span class="lineno">  509</span>&#160;<span class="comment">     * Update the cursor image with the new info (doesn&#39;t do anything unless</span></div>
<div class="line"><a name="l00510"></a><span class="lineno">  510</span>&#160;<span class="comment">     * the cursor is really changing).</span></div>
<div class="line"><a name="l00511"></a><span class="lineno">  511</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00512"></a><span class="lineno">  512</span>&#160;    <a class="code" href="a00638.html#a9f0bf38c04ea2aeebbf17e5f1353ea34">UpdateCursorImage</a>();</div>
<div class="line"><a name="l00513"></a><span class="lineno">  513</span>&#160;}</div>
<div class="line"><a name="l00514"></a><span class="lineno">  514</span>&#160; </div>
<div class="line"><a name="l00515"></a><span class="lineno">  515</span>&#160; </div>
<div class="line"><a name="l00516"></a><span class="lineno"><a class="line" href="a00824.html#aba79315d5a06e7686b253fc75d47985b">  516</a></span>&#160;<span class="preprocessor">#define QUERY_VALUE_BUFFER 80</span></div>
<div class="line"><a name="l00517"></a><span class="lineno">  517</span>&#160; </div>
<div class="line"><a name="l00518"></a><span class="lineno">  518</span>&#160; </div>
<div class="line"><a name="l00526"></a><span class="lineno"><a class="line" href="a00824.html#a2b2ac38b234d1daf66fd52ba7ddf27fc">  526</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#a2b2ac38b234d1daf66fd52ba7ddf27fc">SetAppCompatFlags</a>(</div>
<div class="line"><a name="l00527"></a><span class="lineno">  527</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti)</div>
<div class="line"><a name="l00528"></a><span class="lineno">  528</span>&#160;{</div>
<div class="line"><a name="l00529"></a><span class="lineno">  529</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwFlags = 0;</div>
<div class="line"><a name="l00530"></a><span class="lineno">  530</span>&#160;    WCHAR szHex[<a class="code" href="a00824.html#aba79315d5a06e7686b253fc75d47985b">QUERY_VALUE_BUFFER</a>];</div>
<div class="line"><a name="l00531"></a><span class="lineno">  531</span>&#160;    WCHAR szKey[80];</div>
<div class="line"><a name="l00532"></a><span class="lineno">  532</span>&#160;    WCHAR *pchStart, *pchEnd;</div>
<div class="line"><a name="l00533"></a><span class="lineno">  533</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> cb;</div>
<div class="line"><a name="l00534"></a><span class="lineno">  534</span>&#160;    PUNICODE_STRING pstrAppName;</div>
<div class="line"><a name="l00535"></a><span class="lineno">  535</span>&#160; </div>
<div class="line"><a name="l00536"></a><span class="lineno">  536</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00537"></a><span class="lineno">  537</span>&#160;<span class="comment">     * If this process is WOW, every app (and every thread) has its own</span></div>
<div class="line"><a name="l00538"></a><span class="lineno">  538</span>&#160;<span class="comment">     * compat flags. If not WOW, then we only need to do this lookup</span></div>
<div class="line"><a name="l00539"></a><span class="lineno">  539</span>&#160;<span class="comment">     * once per process.</span></div>
<div class="line"><a name="l00540"></a><span class="lineno">  540</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00541"></a><span class="lineno">  541</span>&#160;    <span class="keywordflow">if</span> (!(pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT)) {</div>
<div class="line"><a name="l00542"></a><span class="lineno">  542</span>&#160;        <span class="keywordflow">if</span> (LOWORD(pti-&gt;<a class="code" href="a02889.html#ac18617bb8bdbcb8e9c73e759b9df75eb">dwExpWinVer</a>) &lt;= VER31) {</div>
<div class="line"><a name="l00543"></a><span class="lineno">  543</span>&#160;            <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;W32PF_Flags &amp; W32PF_HAVECOMPATFLAGS) {</div>
<div class="line"><a name="l00544"></a><span class="lineno">  544</span>&#160;                pti-&gt;<a class="code" href="a02889.html#a44b5958e6b5534a50ebdf2fe332d8118">dwCompatFlags</a> = pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a44b5958e6b5534a50ebdf2fe332d8118">dwCompatFlags</a>;</div>
<div class="line"><a name="l00545"></a><span class="lineno">  545</span>&#160;                pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a44b5958e6b5534a50ebdf2fe332d8118">dwCompatFlags</a> = pti-&gt;<a class="code" href="a02889.html#a44b5958e6b5534a50ebdf2fe332d8118">dwCompatFlags</a>;</div>
<div class="line"><a name="l00546"></a><span class="lineno">  546</span>&#160;                <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l00547"></a><span class="lineno">  547</span>&#160;            }</div>
<div class="line"><a name="l00548"></a><span class="lineno">  548</span>&#160;        }</div>
<div class="line"><a name="l00549"></a><span class="lineno">  549</span>&#160;        <span class="keywordflow">goto</span> SACF_GotFlags;     <span class="comment">// They&#39;re zero; we&#39;re a 3.1 (32 bit) app</span></div>
<div class="line"><a name="l00550"></a><span class="lineno">  550</span>&#160;    }</div>
<div class="line"><a name="l00551"></a><span class="lineno">  551</span>&#160; </div>
<div class="line"><a name="l00552"></a><span class="lineno">  552</span>&#160; </div>
<div class="line"><a name="l00553"></a><span class="lineno">  553</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00554"></a><span class="lineno">  554</span>&#160;<span class="comment">     * Find end of app name</span></div>
<div class="line"><a name="l00555"></a><span class="lineno">  555</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00556"></a><span class="lineno">  556</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a> != NULL)</div>
<div class="line"><a name="l00557"></a><span class="lineno">  557</span>&#160;        pstrAppName = pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a>;</div>
<div class="line"><a name="l00558"></a><span class="lineno">  558</span>&#160;    <span class="keywordflow">else</span></div>
<div class="line"><a name="l00559"></a><span class="lineno">  559</span>&#160;        pstrAppName = &amp;pti-&gt;Thread-&gt;ThreadsProcess-&gt;Peb-&gt;ProcessParameters-&gt;ImagePathName;</div>
<div class="line"><a name="l00560"></a><span class="lineno">  560</span>&#160;    pchStart = pchEnd = pstrAppName-&gt;Buffer +</div>
<div class="line"><a name="l00561"></a><span class="lineno">  561</span>&#160;            (pstrAppName-&gt;Length / <span class="keyword">sizeof</span>(WCHAR));</div>
<div class="line"><a name="l00562"></a><span class="lineno">  562</span>&#160; </div>
<div class="line"><a name="l00563"></a><span class="lineno">  563</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00564"></a><span class="lineno">  564</span>&#160;<span class="comment">     * Locate start of extension</span></div>
<div class="line"><a name="l00565"></a><span class="lineno">  565</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00566"></a><span class="lineno">  566</span>&#160;    <span class="keywordflow">while</span> (TRUE) {</div>
<div class="line"><a name="l00567"></a><span class="lineno">  567</span>&#160;        <span class="keywordflow">if</span> (pchEnd == pstrAppName-&gt;Buffer) {</div>
<div class="line"><a name="l00568"></a><span class="lineno">  568</span>&#160;            pchEnd = pchStart;</div>
<div class="line"><a name="l00569"></a><span class="lineno">  569</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00570"></a><span class="lineno">  570</span>&#160;        }</div>
<div class="line"><a name="l00571"></a><span class="lineno">  571</span>&#160; </div>
<div class="line"><a name="l00572"></a><span class="lineno">  572</span>&#160;        <span class="keywordflow">if</span> (*pchEnd == TEXT(<span class="charliteral">&#39;.&#39;</span>))</div>
<div class="line"><a name="l00573"></a><span class="lineno">  573</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00574"></a><span class="lineno">  574</span>&#160; </div>
<div class="line"><a name="l00575"></a><span class="lineno">  575</span>&#160;        pchEnd--;</div>
<div class="line"><a name="l00576"></a><span class="lineno">  576</span>&#160;    }</div>
<div class="line"><a name="l00577"></a><span class="lineno">  577</span>&#160; </div>
<div class="line"><a name="l00578"></a><span class="lineno">  578</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00579"></a><span class="lineno">  579</span>&#160;<span class="comment">     * Locate start of filename</span></div>
<div class="line"><a name="l00580"></a><span class="lineno">  580</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00581"></a><span class="lineno">  581</span>&#160;    pchStart = pchEnd;</div>
<div class="line"><a name="l00582"></a><span class="lineno">  582</span>&#160; </div>
<div class="line"><a name="l00583"></a><span class="lineno">  583</span>&#160;    <span class="keywordflow">while</span> (pchStart != pstrAppName-&gt;Buffer) {</div>
<div class="line"><a name="l00584"></a><span class="lineno">  584</span>&#160;        <span class="keywordflow">if</span> (*pchStart == TEXT(<span class="charliteral">&#39;\\&#39;</span>) || *pchStart == TEXT(<span class="charliteral">&#39;:&#39;</span>)) {</div>
<div class="line"><a name="l00585"></a><span class="lineno">  585</span>&#160;            pchStart++;</div>
<div class="line"><a name="l00586"></a><span class="lineno">  586</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00587"></a><span class="lineno">  587</span>&#160;        }</div>
<div class="line"><a name="l00588"></a><span class="lineno">  588</span>&#160; </div>
<div class="line"><a name="l00589"></a><span class="lineno">  589</span>&#160;        pchStart--;</div>
<div class="line"><a name="l00590"></a><span class="lineno">  590</span>&#160;    }</div>
<div class="line"><a name="l00591"></a><span class="lineno">  591</span>&#160; </div>
<div class="line"><a name="l00592"></a><span class="lineno">  592</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00593"></a><span class="lineno">  593</span>&#160;<span class="comment">     * Get a copy of the filename - make sure it fits and is zero</span></div>
<div class="line"><a name="l00594"></a><span class="lineno">  594</span>&#160;<span class="comment">     * terminated.</span></div>
<div class="line"><a name="l00595"></a><span class="lineno">  595</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00596"></a><span class="lineno">  596</span>&#160;    cb = (pchEnd - pchStart) * <span class="keyword">sizeof</span>(WCHAR);</div>
<div class="line"><a name="l00597"></a><span class="lineno">  597</span>&#160;    <span class="keywordflow">if</span> (cb &gt;= <span class="keyword">sizeof</span>(szKey))</div>
<div class="line"><a name="l00598"></a><span class="lineno">  598</span>&#160;        cb = <span class="keyword">sizeof</span>(szKey) - <span class="keyword">sizeof</span>(WCHAR);</div>
<div class="line"><a name="l00599"></a><span class="lineno">  599</span>&#160;    RtlCopyMemory(szKey, pchStart, cb);</div>
<div class="line"><a name="l00600"></a><span class="lineno">  600</span>&#160;    szKey[(cb / <span class="keyword">sizeof</span>(WCHAR))] = 0;</div>
<div class="line"><a name="l00601"></a><span class="lineno">  601</span>&#160; </div>
<div class="line"><a name="l00602"></a><span class="lineno">  602</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00603"></a><span class="lineno">  603</span>&#160;<span class="comment">     * Find compatiblility flags (if not a 4.0 app)</span></div>
<div class="line"><a name="l00604"></a><span class="lineno">  604</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00605"></a><span class="lineno">  605</span>&#160;    <span class="keywordflow">if</span> (LOWORD(pti-&gt;<a class="code" href="a02889.html#ac18617bb8bdbcb8e9c73e759b9df75eb">dwExpWinVer</a>) &lt;= VER31)</div>
<div class="line"><a name="l00606"></a><span class="lineno">  606</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="a00821.html#ac17f293887ea0105ad183fc049cd56a1">UT_FastGetProfileStringW</a>(PMAP_COMPAT, szKey, TEXT(<span class="stringliteral">&quot;&quot;</span>),</div>
<div class="line"><a name="l00607"></a><span class="lineno">  607</span>&#160;                szHex, <span class="keyword">sizeof</span>(szHex))) {</div>
<div class="line"><a name="l00608"></a><span class="lineno">  608</span>&#160;            UNICODE_STRING strHex;</div>
<div class="line"><a name="l00609"></a><span class="lineno">  609</span>&#160; </div>
<div class="line"><a name="l00610"></a><span class="lineno">  610</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l00611"></a><span class="lineno">  611</span>&#160;<span class="comment">             * Found some flags.  Attempt to convert the hex string</span></div>
<div class="line"><a name="l00612"></a><span class="lineno">  612</span>&#160;<span class="comment">             * into numeric value. Specify base 0, so</span></div>
<div class="line"><a name="l00613"></a><span class="lineno">  613</span>&#160;<span class="comment">             * RtlUnicodeStringToInteger will handle the 0x format</span></div>
<div class="line"><a name="l00614"></a><span class="lineno">  614</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l00615"></a><span class="lineno">  615</span>&#160;            RtlInitUnicodeString(&amp;strHex, szHex);</div>
<div class="line"><a name="l00616"></a><span class="lineno">  616</span>&#160;            RtlUnicodeStringToInteger(&amp;strHex, 0, (PULONG)&amp;dwFlags);</div>
<div class="line"><a name="l00617"></a><span class="lineno">  617</span>&#160;        }</div>
<div class="line"><a name="l00618"></a><span class="lineno">  618</span>&#160; </div>
<div class="line"><a name="l00619"></a><span class="lineno">  619</span>&#160;SACF_GotFlags:</div>
<div class="line"><a name="l00620"></a><span class="lineno">  620</span>&#160; </div>
<div class="line"><a name="l00621"></a><span class="lineno">  621</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a44b5958e6b5534a50ebdf2fe332d8118">dwCompatFlags</a> = dwFlags;</div>
<div class="line"><a name="l00622"></a><span class="lineno">  622</span>&#160;    pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a44b5958e6b5534a50ebdf2fe332d8118">dwCompatFlags</a> = dwFlags;</div>
<div class="line"><a name="l00623"></a><span class="lineno">  623</span>&#160; </div>
<div class="line"><a name="l00624"></a><span class="lineno">  624</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a44b5958e6b5534a50ebdf2fe332d8118">dwCompatFlags</a> = dwFlags;</div>
<div class="line"><a name="l00625"></a><span class="lineno">  625</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;W32PF_Flags |= W32PF_HAVECOMPATFLAGS;</div>
<div class="line"><a name="l00626"></a><span class="lineno">  626</span>&#160; </div>
<div class="line"><a name="l00627"></a><span class="lineno">  627</span>&#160;}</div>
<div class="line"><a name="l00628"></a><span class="lineno">  628</span>&#160; </div>
<div class="line"><a name="l00629"></a><span class="lineno">  629</span>&#160; </div>
<div class="line"><a name="l00639"></a><span class="lineno"><a class="line" href="a00824.html#af0277284ad14b2b685eb0dcb1f506323">  639</a></span>&#160;<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> <a class="code" href="a00824.html#af0277284ad14b2b685eb0dcb1f506323">GetAppCompatFlags</a>(</div>
<div class="line"><a name="l00640"></a><span class="lineno">  640</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti)</div>
<div class="line"><a name="l00641"></a><span class="lineno">  641</span>&#160;{</div>
<div class="line"><a name="l00642"></a><span class="lineno">  642</span>&#160;    <span class="keywordflow">if</span> (pti == NULL)</div>
<div class="line"><a name="l00643"></a><span class="lineno">  643</span>&#160;        pti = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l00644"></a><span class="lineno">  644</span>&#160; </div>
<div class="line"><a name="l00645"></a><span class="lineno">  645</span>&#160;    <span class="keywordflow">return</span> pti-&gt;<a class="code" href="a02889.html#a44b5958e6b5534a50ebdf2fe332d8118">dwCompatFlags</a>;</div>
<div class="line"><a name="l00646"></a><span class="lineno">  646</span>&#160;}</div>
<div class="line"><a name="l00647"></a><span class="lineno">  647</span>&#160; </div>
<div class="line"><a name="l00648"></a><span class="lineno">  648</span>&#160; </div>
<div class="line"><a name="l00658"></a><span class="lineno"><a class="line" href="a00899.html#a1c923dbf6d39e5d2f2cdbdf2c1587e11">  658</a></span>&#160;NTSTATUS <a class="code" href="a00824.html#a08d4b3aa2685ab73b79068f1b572a57a">xxxInitTask</a>(</div>
<div class="line"><a name="l00659"></a><span class="lineno">  659</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> dwExpWinVer,</div>
<div class="line"><a name="l00660"></a><span class="lineno">  660</span>&#160;    PUNICODE_STRING pstrAppName,</div>
<div class="line"><a name="l00661"></a><span class="lineno">  661</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> hTaskWow,</div>
<div class="line"><a name="l00662"></a><span class="lineno">  662</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwHotkey,</div>
<div class="line"><a name="l00663"></a><span class="lineno">  663</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> idTask,</div>
<div class="line"><a name="l00664"></a><span class="lineno">  664</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwX,</div>
<div class="line"><a name="l00665"></a><span class="lineno">  665</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwY,</div>
<div class="line"><a name="l00666"></a><span class="lineno">  666</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwXSize,</div>
<div class="line"><a name="l00667"></a><span class="lineno">  667</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwYSize,</div>
<div class="line"><a name="l00668"></a><span class="lineno">  668</span>&#160;    WORD  wUnusedAndAvailable)</div>
<div class="line"><a name="l00669"></a><span class="lineno">  669</span>&#160;{</div>
<div class="line"><a name="l00670"></a><span class="lineno">  670</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l00671"></a><span class="lineno">  671</span>&#160;    <a class="code" href="a02881.html">PTDB</a> ptdb;</div>
<div class="line"><a name="l00672"></a><span class="lineno">  672</span>&#160;    <a class="code" href="a02905.html">PPROCESSINFO</a> ppi;</div>
<div class="line"><a name="l00673"></a><span class="lineno">  673</span>&#160;    <a class="code" href="a02877.html">PWOWTHREADINFO</a> pwti;</div>
<div class="line"><a name="l00674"></a><span class="lineno">  674</span>&#160; </div>
<div class="line"><a name="l00675"></a><span class="lineno">  675</span>&#160;    UNREFERENCED_PARAMETER(wUnusedAndAvailable);</div>
<div class="line"><a name="l00676"></a><span class="lineno">  676</span>&#160; </div>
<div class="line"><a name="l00677"></a><span class="lineno">  677</span>&#160;    pti = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l00678"></a><span class="lineno">  678</span>&#160;    ppi = pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>;</div>
<div class="line"><a name="l00679"></a><span class="lineno">  679</span>&#160; </div>
<div class="line"><a name="l00680"></a><span class="lineno">  680</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00681"></a><span class="lineno">  681</span>&#160;<span class="comment">     * Set the real name of the module.  (Instead of &#39;NTVDM&#39;)</span></div>
<div class="line"><a name="l00682"></a><span class="lineno">  682</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00683"></a><span class="lineno">  683</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a> != NULL)</div>
<div class="line"><a name="l00684"></a><span class="lineno">  684</span>&#160;        UserFreePool(pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a>);</div>
<div class="line"><a name="l00685"></a><span class="lineno">  685</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a> = UserAllocPoolWithQuota(<span class="keyword">sizeof</span>(UNICODE_STRING) +</div>
<div class="line"><a name="l00686"></a><span class="lineno">  686</span>&#160;            pstrAppName-&gt;MaximumLength, TAG_TEXT);</div>
<div class="line"><a name="l00687"></a><span class="lineno">  687</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a> != NULL) {</div>
<div class="line"><a name="l00688"></a><span class="lineno">  688</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a>-&gt;Buffer = (PWCHAR)(pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a> + 1);</div>
<div class="line"><a name="l00689"></a><span class="lineno">  689</span>&#160;        <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l00690"></a><span class="lineno">  690</span>&#160;            RtlCopyMemory(pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a>-&gt;Buffer, pstrAppName-&gt;Buffer,</div>
<div class="line"><a name="l00691"></a><span class="lineno">  691</span>&#160;                    pstrAppName-&gt;Length);</div>
<div class="line"><a name="l00692"></a><span class="lineno">  692</span>&#160;        } except (EXCEPTION_EXECUTE_HANDLER) {</div>
<div class="line"><a name="l00693"></a><span class="lineno">  693</span>&#160;            UserFreePool(pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a>);</div>
<div class="line"><a name="l00694"></a><span class="lineno">  694</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a> = NULL;</div>
<div class="line"><a name="l00695"></a><span class="lineno">  695</span>&#160;            <span class="keywordflow">return</span> STATUS_OBJECT_NAME_INVALID;</div>
<div class="line"><a name="l00696"></a><span class="lineno">  696</span>&#160;        }</div>
<div class="line"><a name="l00697"></a><span class="lineno">  697</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a>-&gt;MaximumLength = pstrAppName-&gt;MaximumLength;</div>
<div class="line"><a name="l00698"></a><span class="lineno">  698</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a>-&gt;Length = pstrAppName-&gt;Length;</div>
<div class="line"><a name="l00699"></a><span class="lineno">  699</span>&#160;    } <span class="keywordflow">else</span></div>
<div class="line"><a name="l00700"></a><span class="lineno">  700</span>&#160;        <span class="keywordflow">return</span> STATUS_OBJECT_NAME_INVALID;</div>
<div class="line"><a name="l00701"></a><span class="lineno">  701</span>&#160; </div>
<div class="line"><a name="l00702"></a><span class="lineno">  702</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00703"></a><span class="lineno">  703</span>&#160;<span class="comment">     * An app is starting!</span></div>
<div class="line"><a name="l00704"></a><span class="lineno">  704</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00705"></a><span class="lineno">  705</span>&#160;    <span class="keywordflow">if</span> (!(ppi-&gt;W32PF_Flags &amp; W32PF_APPSTARTING)) {</div>
<div class="line"><a name="l00706"></a><span class="lineno">  706</span>&#160;        ppi-&gt;W32PF_Flags |= W32PF_APPSTARTING;</div>
<div class="line"><a name="l00707"></a><span class="lineno">  707</span>&#160;        ppi-&gt;<a class="code" href="a02905.html#a2306374fe9d8ff9df10b4a7491946258">ppiNext</a> = <a class="code" href="a03257.html#af01477af415dcb7442680606f63b5e29">gppiStarting</a>;</div>
<div class="line"><a name="l00708"></a><span class="lineno">  708</span>&#160;        <a class="code" href="a03257.html#af01477af415dcb7442680606f63b5e29">gppiStarting</a> = ppi;</div>
<div class="line"><a name="l00709"></a><span class="lineno">  709</span>&#160;    }</div>
<div class="line"><a name="l00710"></a><span class="lineno">  710</span>&#160; </div>
<div class="line"><a name="l00711"></a><span class="lineno">  711</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00712"></a><span class="lineno">  712</span>&#160;<span class="comment">     * We never want to use the ShowWindow defaulting mechanism for WOW</span></div>
<div class="line"><a name="l00713"></a><span class="lineno">  713</span>&#160;<span class="comment">     * apps.  If STARTF_USESHOWWINDOW was set in the client-side</span></div>
<div class="line"><a name="l00714"></a><span class="lineno">  714</span>&#160;<span class="comment">     * STARTUPINFO structure, WOW has already picked it up and used</span></div>
<div class="line"><a name="l00715"></a><span class="lineno">  715</span>&#160;<span class="comment">     * it for the first (command-line) app.</span></div>
<div class="line"><a name="l00716"></a><span class="lineno">  716</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00717"></a><span class="lineno">  717</span>&#160;    ppi-&gt;<a class="code" href="a02905.html#a12f7bfd1b0c792cec2292a87a75bc8c5">usi</a>.<a class="code" href="a02781.html#a4d2f405b1141000eb2af256e0fc8b98b">dwFlags</a> &amp;= ~STARTF_USESHOWWINDOW;</div>
<div class="line"><a name="l00718"></a><span class="lineno">  718</span>&#160; </div>
<div class="line"><a name="l00719"></a><span class="lineno">  719</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00720"></a><span class="lineno">  720</span>&#160;<span class="comment">     * If WOW passed us a hotkey for this app, save it for CreateWindow&#39;s use.</span></div>
<div class="line"><a name="l00721"></a><span class="lineno">  721</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00722"></a><span class="lineno">  722</span>&#160;    <span class="keywordflow">if</span> (dwHotkey != 0) {</div>
<div class="line"><a name="l00723"></a><span class="lineno">  723</span>&#160;        ppi-&gt;<a class="code" href="a02905.html#af2dee2144e1b1c252aefa41fb6a2dc37">dwHotkey</a> = dwHotkey;</div>
<div class="line"><a name="l00724"></a><span class="lineno">  724</span>&#160;    }</div>
<div class="line"><a name="l00725"></a><span class="lineno">  725</span>&#160; </div>
<div class="line"><a name="l00726"></a><span class="lineno">  726</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00727"></a><span class="lineno">  727</span>&#160;<span class="comment">     * If WOW passed us a non-default window position use it, otherwise clear it.</span></div>
<div class="line"><a name="l00728"></a><span class="lineno">  728</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00729"></a><span class="lineno">  729</span>&#160;    ppi-&gt;<a class="code" href="a02905.html#a12f7bfd1b0c792cec2292a87a75bc8c5">usi</a>.<a class="code" href="a02781.html#a9ed6a30359da8299f730bdf76bc44dbb">cb</a> = <span class="keyword">sizeof</span>(ppi-&gt;<a class="code" href="a02905.html#a12f7bfd1b0c792cec2292a87a75bc8c5">usi</a>);</div>
<div class="line"><a name="l00730"></a><span class="lineno">  730</span>&#160; </div>
<div class="line"><a name="l00731"></a><span class="lineno">  731</span>&#160;    <span class="keywordflow">if</span> (dwX == CW_USEDEFAULT || dwX == CW2_USEDEFAULT) {</div>
<div class="line"><a name="l00732"></a><span class="lineno">  732</span>&#160;        ppi-&gt;<a class="code" href="a02905.html#a12f7bfd1b0c792cec2292a87a75bc8c5">usi</a>.<a class="code" href="a02781.html#a4d2f405b1141000eb2af256e0fc8b98b">dwFlags</a> &amp;= ~STARTF_USEPOSITION;</div>
<div class="line"><a name="l00733"></a><span class="lineno">  733</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00734"></a><span class="lineno">  734</span>&#160;        ppi-&gt;<a class="code" href="a02905.html#a12f7bfd1b0c792cec2292a87a75bc8c5">usi</a>.<a class="code" href="a02781.html#a4d2f405b1141000eb2af256e0fc8b98b">dwFlags</a> |= STARTF_USEPOSITION;</div>
<div class="line"><a name="l00735"></a><span class="lineno">  735</span>&#160;        ppi-&gt;<a class="code" href="a02905.html#a12f7bfd1b0c792cec2292a87a75bc8c5">usi</a>.<a class="code" href="a02781.html#abbaa6dbe87da7a3d8b7480a3136f8ca8">dwX</a> = dwX;</div>
<div class="line"><a name="l00736"></a><span class="lineno">  736</span>&#160;        ppi-&gt;<a class="code" href="a02905.html#a12f7bfd1b0c792cec2292a87a75bc8c5">usi</a>.<a class="code" href="a02781.html#a256ccde56536d6a94ba1addb6b5ee6db">dwY</a> = dwY;</div>
<div class="line"><a name="l00737"></a><span class="lineno">  737</span>&#160;    }</div>
<div class="line"><a name="l00738"></a><span class="lineno">  738</span>&#160; </div>
<div class="line"><a name="l00739"></a><span class="lineno">  739</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00740"></a><span class="lineno">  740</span>&#160;<span class="comment">     * If WOW passed us a non-default window size use it, otherwise clear it.</span></div>
<div class="line"><a name="l00741"></a><span class="lineno">  741</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00742"></a><span class="lineno">  742</span>&#160;    <span class="keywordflow">if</span> (dwXSize == CW_USEDEFAULT || dwXSize == CW2_USEDEFAULT) {</div>
<div class="line"><a name="l00743"></a><span class="lineno">  743</span>&#160;        ppi-&gt;<a class="code" href="a02905.html#a12f7bfd1b0c792cec2292a87a75bc8c5">usi</a>.<a class="code" href="a02781.html#a4d2f405b1141000eb2af256e0fc8b98b">dwFlags</a> &amp;= ~STARTF_USESIZE;</div>
<div class="line"><a name="l00744"></a><span class="lineno">  744</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l00745"></a><span class="lineno">  745</span>&#160;        ppi-&gt;<a class="code" href="a02905.html#a12f7bfd1b0c792cec2292a87a75bc8c5">usi</a>.<a class="code" href="a02781.html#a4d2f405b1141000eb2af256e0fc8b98b">dwFlags</a> |= STARTF_USESIZE;</div>
<div class="line"><a name="l00746"></a><span class="lineno">  746</span>&#160;        ppi-&gt;<a class="code" href="a02905.html#a12f7bfd1b0c792cec2292a87a75bc8c5">usi</a>.<a class="code" href="a02781.html#ad850b4a870bf162d1807c31eb8353d0b">dwXSize</a> = dwXSize;</div>
<div class="line"><a name="l00747"></a><span class="lineno">  747</span>&#160;        ppi-&gt;<a class="code" href="a02905.html#a12f7bfd1b0c792cec2292a87a75bc8c5">usi</a>.<a class="code" href="a02781.html#ae8e1aaf0b4027957c1918bcaf3d591dd">dwYSize</a> = dwYSize;</div>
<div class="line"><a name="l00748"></a><span class="lineno">  748</span>&#160;    }</div>
<div class="line"><a name="l00749"></a><span class="lineno">  749</span>&#160; </div>
<div class="line"><a name="l00750"></a><span class="lineno">  750</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00751"></a><span class="lineno">  751</span>&#160;<span class="comment">     * Alloc and Link in new task into the task list</span></div>
<div class="line"><a name="l00752"></a><span class="lineno">  752</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00753"></a><span class="lineno">  753</span>&#160;    <span class="keywordflow">if</span> ((ptdb = (<a class="code" href="a02881.html">PTDB</a>)UserAllocPoolWithQuota(<span class="keyword">sizeof</span>(<a class="code" href="a02881.html">TDB</a>), TAG_WOW)) == NULL)</div>
<div class="line"><a name="l00754"></a><span class="lineno">  754</span>&#160;        <span class="keywordflow">return</span> STATUS_NO_MEMORY;</div>
<div class="line"><a name="l00755"></a><span class="lineno">  755</span>&#160;    pti-&gt;<a class="code" href="a02889.html#af8fb3a0f2a65257b83edd457a19dca57">ptdb</a> = ptdb;</div>
<div class="line"><a name="l00756"></a><span class="lineno">  756</span>&#160; </div>
<div class="line"><a name="l00757"></a><span class="lineno">  757</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00758"></a><span class="lineno">  758</span>&#160;<span class="comment">     * Set the flags to say this is a 16-bit thread - before attaching</span></div>
<div class="line"><a name="l00759"></a><span class="lineno">  759</span>&#160;<span class="comment">     * queues!</span></div>
<div class="line"><a name="l00760"></a><span class="lineno">  760</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00761"></a><span class="lineno">  761</span>&#160;    pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> |= TIF_16BIT | TIF_FIRSTIDLE;</div>
<div class="line"><a name="l00762"></a><span class="lineno">  762</span>&#160; </div>
<div class="line"><a name="l00763"></a><span class="lineno">  763</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00764"></a><span class="lineno">  764</span>&#160;<span class="comment">     * If this task is running in the shared WOW VDM, we handle</span></div>
<div class="line"><a name="l00765"></a><span class="lineno">  765</span>&#160;<span class="comment">     * WaitForInputIdle a little differently than separate WOW</span></div>
<div class="line"><a name="l00766"></a><span class="lineno">  766</span>&#160;<span class="comment">     * VDMs.  This is because CreateProcess returns a real process</span></div>
<div class="line"><a name="l00767"></a><span class="lineno">  767</span>&#160;<span class="comment">     * handle when you start a separate WOW VDM, so the &quot;normal&quot;</span></div>
<div class="line"><a name="l00768"></a><span class="lineno">  768</span>&#160;<span class="comment">     * WaitForInputIdle works.  For the shared WOW VDM, CreateProcess</span></div>
<div class="line"><a name="l00769"></a><span class="lineno">  769</span>&#160;<span class="comment">     * returns an event handle.</span></div>
<div class="line"><a name="l00770"></a><span class="lineno">  770</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00771"></a><span class="lineno">  771</span>&#160;    ptdb-&gt;<a class="code" href="a02881.html#a0fac7dfac3f4208f91a3707ef2c25568">pwti</a> = NULL;</div>
<div class="line"><a name="l00772"></a><span class="lineno">  772</span>&#160;    <span class="keywordflow">if</span> (idTask) {</div>
<div class="line"><a name="l00773"></a><span class="lineno">  773</span>&#160;        pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> |= TIF_SHAREDWOW;</div>
<div class="line"><a name="l00774"></a><span class="lineno">  774</span>&#160; </div>
<div class="line"><a name="l00775"></a><span class="lineno">  775</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00776"></a><span class="lineno">  776</span>&#160;<span class="comment">         * Look for a matching thread in the WOW thread info list.</span></div>
<div class="line"><a name="l00777"></a><span class="lineno">  777</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00778"></a><span class="lineno">  778</span>&#160;        <span class="keywordflow">if</span> (idTask != (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)-1) {</div>
<div class="line"><a name="l00779"></a><span class="lineno">  779</span>&#160;            <span class="keywordflow">for</span> (pwti = <a class="code" href="a03257.html#a7a841563d95fb37851ffe2fd252b4384">gpwtiFirst</a>; pwti != NULL; pwti = pwti-&gt;<a class="code" href="a02877.html#acdfce03ff716b350b5b599cfd8717b3a">pwtiNext</a>) {</div>
<div class="line"><a name="l00780"></a><span class="lineno">  780</span>&#160;                <span class="keywordflow">if</span> (pwti-&gt;<a class="code" href="a02877.html#aa366686f75ba96749398a5607305e2e3">idTask</a> == idTask) {</div>
<div class="line"><a name="l00781"></a><span class="lineno">  781</span>&#160;                    ptdb-&gt;<a class="code" href="a02881.html#a0fac7dfac3f4208f91a3707ef2c25568">pwti</a> = pwti;</div>
<div class="line"><a name="l00782"></a><span class="lineno">  782</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l00783"></a><span class="lineno">  783</span>&#160;                }</div>
<div class="line"><a name="l00784"></a><span class="lineno">  784</span>&#160;            }</div>
<div class="line"><a name="l00785"></a><span class="lineno">  785</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l00786"></a><span class="lineno">  786</span>&#160;            <span class="keywordflow">if</span> (pwti == NULL) {</div>
<div class="line"><a name="l00787"></a><span class="lineno">  787</span>&#160;                <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;InitTask couldn&#39;t find WOW struct\n&quot;</span>);</div>
<div class="line"><a name="l00788"></a><span class="lineno">  788</span>&#160;            }</div>
<div class="line"><a name="l00789"></a><span class="lineno">  789</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00790"></a><span class="lineno">  790</span>&#160;        }</div>
<div class="line"><a name="l00791"></a><span class="lineno">  791</span>&#160;    }</div>
<div class="line"><a name="l00792"></a><span class="lineno">  792</span>&#160;    pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a3c509629a36511ee0d17273de6b9d6af">dwTIFlags</a> |= pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a>;</div>
<div class="line"><a name="l00793"></a><span class="lineno">  793</span>&#160; </div>
<div class="line"><a name="l00794"></a><span class="lineno">  794</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00795"></a><span class="lineno">  795</span>&#160;<span class="comment">     * We need this thread to share the queue of other win16 apps.</span></div>
<div class="line"><a name="l00796"></a><span class="lineno">  796</span>&#160;<span class="comment">     * If we&#39;re journalling, all apps are sharing a queue, so we wouldn&#39;t</span></div>
<div class="line"><a name="l00797"></a><span class="lineno">  797</span>&#160;<span class="comment">     * want to interrupt that - so only cause queue recalculation</span></div>
<div class="line"><a name="l00798"></a><span class="lineno">  798</span>&#160;<span class="comment">     * if we aren&#39;t journalling.</span></div>
<div class="line"><a name="l00799"></a><span class="lineno">  799</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00800"></a><span class="lineno">  800</span>&#160;    <span class="keywordflow">if</span> (!FJOURNALRECORD() &amp;&amp; !FJOURNALPLAYBACK())</div>
<div class="line"><a name="l00801"></a><span class="lineno">  801</span>&#160;        <a class="code" href="a03290.html#a555a50540fc3e5009b8d9262e0702592">ReattachThreads</a>(FALSE);</div>
<div class="line"><a name="l00802"></a><span class="lineno">  802</span>&#160; </div>
<div class="line"><a name="l00803"></a><span class="lineno">  803</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00804"></a><span class="lineno">  804</span>&#160;<span class="comment">     * Save away the 16 bit task handle: we use this later when calling</span></div>
<div class="line"><a name="l00805"></a><span class="lineno">  805</span>&#160;<span class="comment">     * wow back to close a WOW task.</span></div>
<div class="line"><a name="l00806"></a><span class="lineno">  806</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00807"></a><span class="lineno">  807</span>&#160;    ptdb-&gt;<a class="code" href="a02881.html#aeabb91a1bd6171bbe97ebb98b926ec63">hTaskWow</a> = hTaskWow;</div>
<div class="line"><a name="l00808"></a><span class="lineno">  808</span>&#160; </div>
<div class="line"><a name="l00809"></a><span class="lineno">  809</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00810"></a><span class="lineno">  810</span>&#160;<span class="comment">     * Setup the app start cursor for 5 second timeout.</span></div>
<div class="line"><a name="l00811"></a><span class="lineno">  811</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00812"></a><span class="lineno">  812</span>&#160;    <a class="code" href="a00824.html#a38b809c615e10eca863b213d461e7040">CalcStartCursorHide</a>((PW32PROCESS)ppi, 5000);</div>
<div class="line"><a name="l00813"></a><span class="lineno">  813</span>&#160; </div>
<div class="line"><a name="l00814"></a><span class="lineno">  814</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00815"></a><span class="lineno">  815</span>&#160;<span class="comment">     * HIWORD: != 0 if wants proportional font</span></div>
<div class="line"><a name="l00816"></a><span class="lineno">  816</span>&#160;<span class="comment">     * LOWORD: Expected windows version (3.00 [300], 3.10 [30A], etc)</span></div>
<div class="line"><a name="l00817"></a><span class="lineno">  817</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00818"></a><span class="lineno">  818</span>&#160;    pti-&gt;<a class="code" href="a02889.html#ac18617bb8bdbcb8e9c73e759b9df75eb">dwExpWinVer</a> = dwExpWinVer;</div>
<div class="line"><a name="l00819"></a><span class="lineno">  819</span>&#160;    pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#ac18617bb8bdbcb8e9c73e759b9df75eb">dwExpWinVer</a> = dwExpWinVer;</div>
<div class="line"><a name="l00820"></a><span class="lineno">  820</span>&#160; </div>
<div class="line"><a name="l00821"></a><span class="lineno">  821</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00822"></a><span class="lineno">  822</span>&#160;<span class="comment">     * Mark this guy and add him to the global task list so he can run.</span></div>
<div class="line"><a name="l00823"></a><span class="lineno">  823</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00824"></a><span class="lineno">  824</span>&#160;<span class="preprocessor">#define NORMAL_PRIORITY_TASK 10</span></div>
<div class="line"><a name="l00825"></a><span class="lineno">  825</span>&#160; </div>
<div class="line"><a name="l00826"></a><span class="lineno">  826</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00827"></a><span class="lineno">  827</span>&#160;<span class="comment">     * To be Compatible it super important that the new task run immediately</span></div>
<div class="line"><a name="l00828"></a><span class="lineno">  828</span>&#160;<span class="comment">     * Set its priority accordingly.  No other task should ever be set to</span></div>
<div class="line"><a name="l00829"></a><span class="lineno">  829</span>&#160;<span class="comment">     * CREATION priority</span></div>
<div class="line"><a name="l00830"></a><span class="lineno">  830</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00831"></a><span class="lineno">  831</span>&#160;    ptdb-&gt;<a class="code" href="a02881.html#aa42e3dbb30b0274b2ccf7b2ccd7fdcad">nPriority</a> = <a class="code" href="a00824.html#abd2ad2672e1d5b70b9884ce7faeab2a5">NORMAL_PRIORITY_TASK</a>;</div>
<div class="line"><a name="l00832"></a><span class="lineno">  832</span>&#160;    ptdb-&gt;<a class="code" href="a02881.html#a6f032dae4131c13bd5080db077f4e158">nEvents</a> = 0;</div>
<div class="line"><a name="l00833"></a><span class="lineno">  833</span>&#160;    ptdb-&gt;<a class="code" href="a02881.html#a774eeae0f007ae3ea612baf38cd38936">pti</a> = pti;</div>
<div class="line"><a name="l00834"></a><span class="lineno">  834</span>&#160;    ptdb-&gt;<a class="code" href="a02881.html#a22132b3713c94f0f3034542da138061d">ptdbNext</a> = NULL;</div>
<div class="line"><a name="l00835"></a><span class="lineno">  835</span>&#160; </div>
<div class="line"><a name="l00836"></a><span class="lineno">  836</span>&#160;    <a class="code" href="a00881.html#a9cbb6a67b65dbeac7e3d6e52482bd052">InsertTask</a>(ppi, ptdb);</div>
<div class="line"><a name="l00837"></a><span class="lineno">  837</span>&#160; </div>
<div class="line"><a name="l00838"></a><span class="lineno">  838</span>&#160;    <a class="code" href="a00824.html#a2b2ac38b234d1daf66fd52ba7ddf27fc">SetAppCompatFlags</a>(pti);</div>
<div class="line"><a name="l00839"></a><span class="lineno">  839</span>&#160; </div>
<div class="line"><a name="l00840"></a><span class="lineno">  840</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00841"></a><span class="lineno">  841</span>&#160;<span class="comment">     * Force this new task to be the active task (WOW will ensure the</span></div>
<div class="line"><a name="l00842"></a><span class="lineno">  842</span>&#160;<span class="comment">     * currently running task does a Yield which will put it into the</span></div>
<div class="line"><a name="l00843"></a><span class="lineno">  843</span>&#160;<span class="comment">     * non preemptive scheduler.</span></div>
<div class="line"><a name="l00844"></a><span class="lineno">  844</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00845"></a><span class="lineno">  845</span>&#160;    ppi-&gt;pwpi-&gt;ptiScheduled = pti;</div>
<div class="line"><a name="l00846"></a><span class="lineno">  846</span>&#160;    ppi-&gt;pwpi-&gt;CSLockCount = -1;</div>
<div class="line"><a name="l00847"></a><span class="lineno">  847</span>&#160; </div>
<div class="line"><a name="l00848"></a><span class="lineno">  848</span>&#160;    <a class="code" href="a00899.html#a610540c7d8f62d34a71d42955314f883">EnterWowCritSect</a>(pti, ppi-&gt;pwpi);</div>
<div class="line"><a name="l00849"></a><span class="lineno">  849</span>&#160; </div>
<div class="line"><a name="l00850"></a><span class="lineno">  850</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00851"></a><span class="lineno">  851</span>&#160;<span class="comment">     * ensure app gets focus</span></div>
<div class="line"><a name="l00852"></a><span class="lineno">  852</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00853"></a><span class="lineno">  853</span>&#160;    <a class="code" href="a00824.html#ac029c0868dfa0a33a2bdd9f9c3633342">_ShowStartGlass</a>(10000);</div>
<div class="line"><a name="l00854"></a><span class="lineno">  854</span>&#160; </div>
<div class="line"><a name="l00855"></a><span class="lineno">  855</span>&#160;    <span class="keywordflow">return</span> STATUS_SUCCESS;</div>
<div class="line"><a name="l00856"></a><span class="lineno">  856</span>&#160;}</div>
<div class="line"><a name="l00857"></a><span class="lineno">  857</span>&#160; </div>
<div class="line"><a name="l00858"></a><span class="lineno">  858</span>&#160; </div>
<div class="line"><a name="l00867"></a><span class="lineno"><a class="line" href="a00899.html#ac029c0868dfa0a33a2bdd9f9c3633342">  867</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#ac029c0868dfa0a33a2bdd9f9c3633342">_ShowStartGlass</a>(</div>
<div class="line"><a name="l00868"></a><span class="lineno">  868</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwTimeout)</div>
<div class="line"><a name="l00869"></a><span class="lineno">  869</span>&#160;{</div>
<div class="line"><a name="l00870"></a><span class="lineno">  870</span>&#160;    <a class="code" href="a02905.html">PPROCESSINFO</a> ppi;</div>
<div class="line"><a name="l00871"></a><span class="lineno">  871</span>&#160; </div>
<div class="line"><a name="l00872"></a><span class="lineno">  872</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00873"></a><span class="lineno">  873</span>&#160;<span class="comment">     * If this is the first call to ShowStartGlass(), then the</span></div>
<div class="line"><a name="l00874"></a><span class="lineno">  874</span>&#160;<span class="comment">     * W32PF_ALLOWFOREGROUNDACTIVATE bit has already been set in the process</span></div>
<div class="line"><a name="l00875"></a><span class="lineno">  875</span>&#160;<span class="comment">     * info - we don&#39;t want to set it again because it may have been</span></div>
<div class="line"><a name="l00876"></a><span class="lineno">  876</span>&#160;<span class="comment">     * purposefully cleared when the user hit a key or mouse clicked.</span></div>
<div class="line"><a name="l00877"></a><span class="lineno">  877</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00878"></a><span class="lineno">  878</span>&#160;    ppi = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>()-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>;</div>
<div class="line"><a name="l00879"></a><span class="lineno">  879</span>&#160;    <span class="keywordflow">if</span> (ppi-&gt;W32PF_Flags &amp; W32PF_SHOWSTARTGLASSCALLED) {</div>
<div class="line"><a name="l00880"></a><span class="lineno">  880</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l00881"></a><span class="lineno">  881</span>&#160;<span class="comment">         * Allow this wow app to come to the foreground. This&#39;ll be cancelled</span></div>
<div class="line"><a name="l00882"></a><span class="lineno">  882</span>&#160;<span class="comment">         * if the user mouse clicks or hits any keys.</span></div>
<div class="line"><a name="l00883"></a><span class="lineno">  883</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l00884"></a><span class="lineno">  884</span>&#160;        <a class="code" href="a03257.html#acdbf053b054e159961f2ba3d6e577bfc">gfAllowForegroundActivate</a> = TRUE;</div>
<div class="line"><a name="l00885"></a><span class="lineno">  885</span>&#160;        ppi-&gt;W32PF_Flags |= W32PF_ALLOWFOREGROUNDACTIVATE;</div>
<div class="line"><a name="l00886"></a><span class="lineno">  886</span>&#160;    }</div>
<div class="line"><a name="l00887"></a><span class="lineno">  887</span>&#160;    ppi-&gt;W32PF_Flags |= W32PF_SHOWSTARTGLASSCALLED;</div>
<div class="line"><a name="l00888"></a><span class="lineno">  888</span>&#160; </div>
<div class="line"><a name="l00889"></a><span class="lineno">  889</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00890"></a><span class="lineno">  890</span>&#160;<span class="comment">     * Show the start glass cursor for this much longer.</span></div>
<div class="line"><a name="l00891"></a><span class="lineno">  891</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00892"></a><span class="lineno">  892</span>&#160;    <a class="code" href="a00824.html#a38b809c615e10eca863b213d461e7040">CalcStartCursorHide</a>((PW32PROCESS)ppi, dwTimeout);</div>
<div class="line"><a name="l00893"></a><span class="lineno">  893</span>&#160;}</div>
<div class="line"><a name="l00894"></a><span class="lineno">  894</span>&#160; </div>
<div class="line"><a name="l00895"></a><span class="lineno">  895</span>&#160; </div>
<div class="line"><a name="l00904"></a><span class="lineno"><a class="line" href="a00824.html#a6e0a0685504f087ee37b9165459b305b">  904</a></span>&#160;<span class="preprocessor">#define STARTF_SCREENSAVER 0x80000000</span></div>
<div class="line"><a name="l00905"></a><span class="lineno">  905</span>&#160; </div>
<div class="line"><a name="l00906"></a><span class="lineno"><a class="line" href="a00824.html#ada31cc49cd6c9b760343ae21f7fec29c">  906</a></span>&#160;ULONG <a class="code" href="a00824.html#ada31cc49cd6c9b760343ae21f7fec29c">ParseReserved</a>(</div>
<div class="line"><a name="l00907"></a><span class="lineno">  907</span>&#160;    WCHAR *pchReserved,</div>
<div class="line"><a name="l00908"></a><span class="lineno">  908</span>&#160;    WCHAR *pchFind)</div>
<div class="line"><a name="l00909"></a><span class="lineno">  909</span>&#160;{</div>
<div class="line"><a name="l00910"></a><span class="lineno">  910</span>&#160;    ULONG dw;</div>
<div class="line"><a name="l00911"></a><span class="lineno">  911</span>&#160;    WCHAR *pch, *pchT, ch;</div>
<div class="line"><a name="l00912"></a><span class="lineno">  912</span>&#160;    UNICODE_STRING uString;</div>
<div class="line"><a name="l00913"></a><span class="lineno">  913</span>&#160; </div>
<div class="line"><a name="l00914"></a><span class="lineno">  914</span>&#160;    dw = 0;</div>
<div class="line"><a name="l00915"></a><span class="lineno">  915</span>&#160;    <span class="keywordflow">if</span> (pchReserved != NULL &amp;&amp; (pch = wcsstr(pchReserved, pchFind)) != NULL) {</div>
<div class="line"><a name="l00916"></a><span class="lineno">  916</span>&#160;        pch += wcslen(pchFind);</div>
<div class="line"><a name="l00917"></a><span class="lineno">  917</span>&#160; </div>
<div class="line"><a name="l00918"></a><span class="lineno">  918</span>&#160;        pchT = pch;</div>
<div class="line"><a name="l00919"></a><span class="lineno">  919</span>&#160;        <span class="keywordflow">while</span> (*pchT &gt;= <span class="charliteral">&#39;0&#39;</span> &amp;&amp; *pchT &lt;= <span class="charliteral">&#39;9&#39;</span>)</div>
<div class="line"><a name="l00920"></a><span class="lineno">  920</span>&#160;            pchT++;</div>
<div class="line"><a name="l00921"></a><span class="lineno">  921</span>&#160; </div>
<div class="line"><a name="l00922"></a><span class="lineno">  922</span>&#160;        ch = *pchT;</div>
<div class="line"><a name="l00923"></a><span class="lineno">  923</span>&#160;        *pchT = 0;</div>
<div class="line"><a name="l00924"></a><span class="lineno">  924</span>&#160;        RtlInitUnicodeString(&amp;uString, pch);</div>
<div class="line"><a name="l00925"></a><span class="lineno">  925</span>&#160;        *pchT = ch;</div>
<div class="line"><a name="l00926"></a><span class="lineno">  926</span>&#160; </div>
<div class="line"><a name="l00927"></a><span class="lineno">  927</span>&#160;        RtlUnicodeStringToInteger(&amp;uString, 0, &amp;dw);</div>
<div class="line"><a name="l00928"></a><span class="lineno">  928</span>&#160;    }</div>
<div class="line"><a name="l00929"></a><span class="lineno">  929</span>&#160; </div>
<div class="line"><a name="l00930"></a><span class="lineno">  930</span>&#160;    <span class="keywordflow">return</span> dw;</div>
<div class="line"><a name="l00931"></a><span class="lineno">  931</span>&#160;}</div>
<div class="line"><a name="l00932"></a><span class="lineno">  932</span>&#160; </div>
<div class="line"><a name="l00933"></a><span class="lineno"><a class="line" href="a00899.html#a1d39d3e23279f358835e7f847a727380">  933</a></span>&#160;NTSTATUS <a class="code" href="a00824.html#abfd2ef0f8a995e8d2f10f8f0248faf5e">xxxCreateThreadInfo</a>(</div>
<div class="line"><a name="l00934"></a><span class="lineno">  934</span>&#160;    PW32THREAD W32Thread)</div>
<div class="line"><a name="l00935"></a><span class="lineno">  935</span>&#160;{</div>
<div class="line"><a name="l00936"></a><span class="lineno">  936</span>&#160;    <a class="code" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a>                     Thread = W32Thread-&gt;Thread;</div>
<div class="line"><a name="l00937"></a><span class="lineno">  937</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>                        dwTIFlags = 0;</div>
<div class="line"><a name="l00938"></a><span class="lineno">  938</span>&#160;    <a class="code" href="a02905.html">PPROCESSINFO</a>                 ppi;</div>
<div class="line"><a name="l00939"></a><span class="lineno">  939</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a>                  pti;</div>
<div class="line"><a name="l00940"></a><span class="lineno">  940</span>&#160;    PEPROCESS                    Process = Thread-&gt;ThreadsProcess;</div>
<div class="line"><a name="l00941"></a><span class="lineno">  941</span>&#160;    <a class="code" href="a02781.html">PUSERSTARTUPINFO</a>             pusi;</div>
<div class="line"><a name="l00942"></a><span class="lineno">  942</span>&#160;    PRTL_USER_PROCESS_PARAMETERS ProcessParams;</div>
<div class="line"><a name="l00943"></a><span class="lineno">  943</span>&#160;    <a class="code" href="a02801.html">PDESKTOP</a>                     pdesk = NULL;</div>
<div class="line"><a name="l00944"></a><span class="lineno">  944</span>&#160;    HDESK                        hdesk = NULL;</div>
<div class="line"><a name="l00945"></a><span class="lineno">  945</span>&#160;    HWINSTA                      hwinsta;</div>
<div class="line"><a name="l00946"></a><span class="lineno">  946</span>&#160;    <a class="code" href="a02869.html">PQ</a>                           pq;</div>
<div class="line"><a name="l00947"></a><span class="lineno">  947</span>&#160;    NTSTATUS                     Status;</div>
<div class="line"><a name="l00948"></a><span class="lineno">  948</span>&#160;    BOOL                         fFirstThread;</div>
<div class="line"><a name="l00949"></a><span class="lineno">  949</span>&#160;    PTEB                         pteb = NtCurrentTeb();</div>
<div class="line"><a name="l00950"></a><span class="lineno">  950</span>&#160; </div>
<div class="line"><a name="l00951"></a><span class="lineno">  951</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00952"></a><span class="lineno">  952</span>&#160;<span class="comment">     * Although all threads now have a ETHREAD structure, server-side</span></div>
<div class="line"><a name="l00953"></a><span class="lineno">  953</span>&#160;<span class="comment">     * threads (RIT, Console, etc) don&#39;t have a client-server eventpair</span></div>
<div class="line"><a name="l00954"></a><span class="lineno">  954</span>&#160;<span class="comment">     * handle.  We use this to distinguish the two cases.</span></div>
<div class="line"><a name="l00955"></a><span class="lineno">  955</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00956"></a><span class="lineno">  956</span>&#160;    <span class="keywordflow">if</span> (IS_SYSTEM_THREAD(Thread)) {</div>
<div class="line"><a name="l00957"></a><span class="lineno">  957</span>&#160;<span class="preprocessor">#ifdef FE_IME</span></div>
<div class="line"><a name="l00958"></a><span class="lineno">  958</span>&#160;        dwTIFlags = TIF_SYSTEMTHREAD | TIF_DONTATTACHQUEUE | TIF_DISABLEIME;</div>
<div class="line"><a name="l00959"></a><span class="lineno">  959</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00960"></a><span class="lineno">  960</span>&#160;        dwTIFlags = TIF_SYSTEMTHREAD | TIF_DONTATTACHQUEUE;</div>
<div class="line"><a name="l00961"></a><span class="lineno">  961</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00962"></a><span class="lineno">  962</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (Process == <a class="code" href="a03257.html#a3eabb6cc6d3b24f411b7f94f5d6edac6">gpepCSRSS</a>) {</div>
<div class="line"><a name="l00963"></a><span class="lineno">  963</span>&#160;<span class="preprocessor">#ifdef FE_IME</span></div>
<div class="line"><a name="l00964"></a><span class="lineno">  964</span>&#160;        dwTIFlags = TIF_CSRSSTHREAD | TIF_DONTATTACHQUEUE | TIF_DISABLEIME;</div>
<div class="line"><a name="l00965"></a><span class="lineno">  965</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l00966"></a><span class="lineno">  966</span>&#160;        dwTIFlags = TIF_CSRSSTHREAD | TIF_DONTATTACHQUEUE;</div>
<div class="line"><a name="l00967"></a><span class="lineno">  967</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00968"></a><span class="lineno">  968</span>&#160;    }</div>
<div class="line"><a name="l00969"></a><span class="lineno">  969</span>&#160; </div>
<div class="line"><a name="l00970"></a><span class="lineno">  970</span>&#160;    ProcessParams = (Process-&gt;Peb ? Process-&gt;Peb-&gt;ProcessParameters : NULL);</div>
<div class="line"><a name="l00971"></a><span class="lineno">  971</span>&#160; </div>
<div class="line"><a name="l00972"></a><span class="lineno">  972</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00973"></a><span class="lineno">  973</span>&#160;<span class="comment">     * Locate the processinfo structure for the new thread.</span></div>
<div class="line"><a name="l00974"></a><span class="lineno">  974</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00975"></a><span class="lineno">  975</span>&#160;    ppi = PpiCurrent();</div>
<div class="line"><a name="l00976"></a><span class="lineno">  976</span>&#160; </div>
<div class="line"><a name="l00977"></a><span class="lineno">  977</span>&#160; </div>
<div class="line"><a name="l00978"></a><span class="lineno">  978</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00979"></a><span class="lineno">  979</span>&#160;<span class="comment">     * Allocate the thread-info structure.  If it&#39;s a SYSTEMTHREAD, then</span></div>
<div class="line"><a name="l00980"></a><span class="lineno">  980</span>&#160;<span class="comment">     * make sure we have enough space for the (pwinsta) pointer.  This</span></div>
<div class="line"><a name="l00981"></a><span class="lineno">  981</span>&#160;<span class="comment">     * is referenced in (paint.c: DoPaint) to assure desktop/input can</span></div>
<div class="line"><a name="l00982"></a><span class="lineno">  982</span>&#160;<span class="comment">     * have a winsta to view.</span></div>
<div class="line"><a name="l00983"></a><span class="lineno">  983</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l00984"></a><span class="lineno">  984</span>&#160;    pti = (<a class="code" href="a00365.html#a177dce23f2b497ba8dc22f5a92d3f3d3">PTHREADINFO</a>)W32Thread;</div>
<div class="line"><a name="l00985"></a><span class="lineno">  985</span>&#160; </div>
<div class="line"><a name="l00986"></a><span class="lineno">  986</span>&#160;    pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> = dwTIFlags;</div>
<div class="line"><a name="l00987"></a><span class="lineno">  987</span>&#160;    pti-&gt;<a class="code" href="a02889.html#aab41ffe1ce08bf84e59f07b0318b22d7">ptl</a>       = NULL;</div>
<div class="line"><a name="l00988"></a><span class="lineno">  988</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a1f6c6f6552be63e92bb242568771ee14">pmsd</a>      = NULL;</div>
<div class="line"><a name="l00989"></a><span class="lineno">  989</span>&#160;    pti-&gt;Thread    = (<a class="code" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a>)Thread;</div>
<div class="line"><a name="l00990"></a><span class="lineno">  990</span>&#160;    Lock(&amp;pti-&gt;<a class="code" href="a02889.html#a09237cbbe78ba3aebf853599bced5ac8">spklActive</a>, <a class="code" href="a03257.html#a25f03eea622def9f9059f147118d2dcb">gspklBaseLayout</a>);</div>
<div class="line"><a name="l00991"></a><span class="lineno">  991</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>      = &amp;(pti-&gt;<a class="code" href="a02889.html#a600a7e9e5efe8158b113973e9f65b6fa">cti</a>);</div>
<div class="line"><a name="l00992"></a><span class="lineno">  992</span>&#160;<span class="preprocessor">#ifdef FE_IME</span></div>
<div class="line"><a name="l00993"></a><span class="lineno">  993</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a4c966c8862344a6b01ddbc4d26a9fe2f">spwndDefaultIme</a> = NULL;</div>
<div class="line"><a name="l00994"></a><span class="lineno">  994</span>&#160;    pti-&gt;<a class="code" href="a02889.html#ace0cb78fad7ebb7cfd46f3918700cff8">spDefaultImc</a>    = NULL;</div>
<div class="line"><a name="l00995"></a><span class="lineno">  995</span>&#160;    pti-&gt;<a class="code" href="a02889.html#ac94f44bcce30243b8e6694862ed82bf7">hklPrev</a>         = (HKL)0;</div>
<div class="line"><a name="l00996"></a><span class="lineno">  996</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l00997"></a><span class="lineno">  997</span>&#160; </div>
<div class="line"><a name="l00998"></a><span class="lineno">  998</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l00999"></a><span class="lineno">  999</span>&#160;<span class="comment">     * Hook up this queue to this process info structure, increment</span></div>
<div class="line"><a name="l01000"></a><span class="lineno"> 1000</span>&#160;<span class="comment">     * the count of threads using this process info structure. Set up</span></div>
<div class="line"><a name="l01001"></a><span class="lineno"> 1001</span>&#160;<span class="comment">     * the ppi before calling SetForegroundPriority().</span></div>
<div class="line"><a name="l01002"></a><span class="lineno"> 1002</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01003"></a><span class="lineno"> 1003</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(ppi != NULL);</div>
<div class="line"><a name="l01004"></a><span class="lineno"> 1004</span>&#160; </div>
<div class="line"><a name="l01005"></a><span class="lineno"> 1005</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>        = ppi;</div>
<div class="line"><a name="l01006"></a><span class="lineno"> 1006</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a318c1d57c31936937fb02314df457e08">ptiSibling</a> = ppi-&gt;<a class="code" href="a02905.html#a8dec25df4d4163bb209f9f8c1bc70d45">ptiList</a>;</div>
<div class="line"><a name="l01007"></a><span class="lineno"> 1007</span>&#160;    ppi-&gt;<a class="code" href="a02905.html#a8dec25df4d4163bb209f9f8c1bc70d45">ptiList</a>    = pti;</div>
<div class="line"><a name="l01008"></a><span class="lineno"> 1008</span>&#160;    ppi-&gt;<a class="code" href="a02905.html#a612848a41faf6b99a0532dc84d375727">cThreads</a>++;</div>
<div class="line"><a name="l01009"></a><span class="lineno"> 1009</span>&#160; </div>
<div class="line"><a name="l01010"></a><span class="lineno"> 1010</span>&#160; </div>
<div class="line"><a name="l01011"></a><span class="lineno"> 1011</span>&#160;    <span class="keywordflow">if</span> (pteb != NULL)</div>
<div class="line"><a name="l01012"></a><span class="lineno"> 1012</span>&#160;        pteb-&gt;Win32ThreadInfo = pti;</div>
<div class="line"><a name="l01013"></a><span class="lineno"> 1013</span>&#160; </div>
<div class="line"><a name="l01014"></a><span class="lineno"> 1014</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01015"></a><span class="lineno"> 1015</span>&#160;<span class="comment">     * Point to the client info.</span></div>
<div class="line"><a name="l01016"></a><span class="lineno"> 1016</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01017"></a><span class="lineno"> 1017</span>&#160;    <span class="keywordflow">if</span> (dwTIFlags &amp; TIF_SYSTEMTHREAD) {</div>
<div class="line"><a name="l01018"></a><span class="lineno"> 1018</span>&#160;        pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a> = UserAllocPoolWithQuota(<span class="keyword">sizeof</span>(<a class="code" href="a02477.html">CLIENTINFO</a>),</div>
<div class="line"><a name="l01019"></a><span class="lineno"> 1019</span>&#160;                                                  TAG_THREADINFO);</div>
<div class="line"><a name="l01020"></a><span class="lineno"> 1020</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a> == NULL) {</div>
<div class="line"><a name="l01021"></a><span class="lineno"> 1021</span>&#160;            Status = STATUS_NO_MEMORY;</div>
<div class="line"><a name="l01022"></a><span class="lineno"> 1022</span>&#160;            <span class="keywordflow">goto</span> CreateThreadInfoFailed;</div>
<div class="line"><a name="l01023"></a><span class="lineno"> 1023</span>&#160;        }</div>
<div class="line"><a name="l01024"></a><span class="lineno"> 1024</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01025"></a><span class="lineno"> 1025</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01026"></a><span class="lineno"> 1026</span>&#160;<span class="comment">         * If this is not a system thread then grab the user mode client info</span></div>
<div class="line"><a name="l01027"></a><span class="lineno"> 1027</span>&#160;<span class="comment">         * elsewhere we use the GetClientInfo macro which looks here</span></div>
<div class="line"><a name="l01028"></a><span class="lineno"> 1028</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01029"></a><span class="lineno"> 1029</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(NtCurrentTeb() != NULL);</div>
<div class="line"><a name="l01030"></a><span class="lineno"> 1030</span>&#160;        pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a> = ((<a class="code" href="a00365.html#ae89734b83f845f738d3f062ea7410a54">PCLIENTINFO</a>)((NtCurrentTeb())-&gt;Win32ClientInfo));</div>
<div class="line"><a name="l01031"></a><span class="lineno"> 1031</span>&#160;    }</div>
<div class="line"><a name="l01032"></a><span class="lineno"> 1032</span>&#160; </div>
<div class="line"><a name="l01033"></a><span class="lineno"> 1033</span>&#160; </div>
<div class="line"><a name="l01034"></a><span class="lineno"> 1034</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01035"></a><span class="lineno"> 1035</span>&#160;<span class="comment">     * Create the input event.</span></div>
<div class="line"><a name="l01036"></a><span class="lineno"> 1036</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01037"></a><span class="lineno"> 1037</span>&#160;    Status = ZwCreateEvent(&amp;pti-&gt;<a class="code" href="a02889.html#a3c194fec8e59a3c52d6c3018cff46ae9">hEventQueueClient</a>,</div>
<div class="line"><a name="l01038"></a><span class="lineno"> 1038</span>&#160;                           EVENT_ALL_ACCESS,</div>
<div class="line"><a name="l01039"></a><span class="lineno"> 1039</span>&#160;                           NULL,</div>
<div class="line"><a name="l01040"></a><span class="lineno"> 1040</span>&#160;                           SynchronizationEvent,</div>
<div class="line"><a name="l01041"></a><span class="lineno"> 1041</span>&#160;                           FALSE);</div>
<div class="line"><a name="l01042"></a><span class="lineno"> 1042</span>&#160; </div>
<div class="line"><a name="l01043"></a><span class="lineno"> 1043</span>&#160;    <span class="keywordflow">if</span> (NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l01044"></a><span class="lineno"> 1044</span>&#160;        Status = ObReferenceObjectByHandle(pti-&gt;<a class="code" href="a02889.html#a3c194fec8e59a3c52d6c3018cff46ae9">hEventQueueClient</a>,</div>
<div class="line"><a name="l01045"></a><span class="lineno"> 1045</span>&#160;                                           EVENT_ALL_ACCESS,</div>
<div class="line"><a name="l01046"></a><span class="lineno"> 1046</span>&#160;                                           NULL,</div>
<div class="line"><a name="l01047"></a><span class="lineno"> 1047</span>&#160;                                           UserMode,</div>
<div class="line"><a name="l01048"></a><span class="lineno"> 1048</span>&#160;                                           &amp;pti-&gt;<a class="code" href="a02889.html#a64da47920250096684c62e566c661139">pEventQueueServer</a>,</div>
<div class="line"><a name="l01049"></a><span class="lineno"> 1049</span>&#160;                                           NULL);</div>
<div class="line"><a name="l01050"></a><span class="lineno"> 1050</span>&#160;        <span class="keywordflow">if</span> (NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l01051"></a><span class="lineno"> 1051</span>&#160;            Status = <a class="code" href="a00680.html#a481c734b3eea8139a042653549741891">ProtectHandle</a>(pti-&gt;<a class="code" href="a02889.html#a3c194fec8e59a3c52d6c3018cff46ae9">hEventQueueClient</a>, TRUE);</div>
<div class="line"><a name="l01052"></a><span class="lineno"> 1052</span>&#160;        } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (Status == STATUS_INVALID_HANDLE) {</div>
<div class="line"><a name="l01053"></a><span class="lineno"> 1053</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a3c194fec8e59a3c52d6c3018cff46ae9">hEventQueueClient</a> = NULL;</div>
<div class="line"><a name="l01054"></a><span class="lineno"> 1054</span>&#160;        }</div>
<div class="line"><a name="l01055"></a><span class="lineno"> 1055</span>&#160;    }</div>
<div class="line"><a name="l01056"></a><span class="lineno"> 1056</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l01057"></a><span class="lineno"> 1057</span>&#160;        <span class="keywordflow">goto</span> CreateThreadInfoFailed;</div>
<div class="line"><a name="l01058"></a><span class="lineno"> 1058</span>&#160;    }</div>
<div class="line"><a name="l01059"></a><span class="lineno"> 1059</span>&#160; </div>
<div class="line"><a name="l01060"></a><span class="lineno"> 1060</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01061"></a><span class="lineno"> 1061</span>&#160;<span class="comment">     * Mark the process as having threads that need cleanup.  See</span></div>
<div class="line"><a name="l01062"></a><span class="lineno"> 1062</span>&#160;<span class="comment">     * DestroyProcessesObjects().</span></div>
<div class="line"><a name="l01063"></a><span class="lineno"> 1063</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01064"></a><span class="lineno"> 1064</span>&#160;    fFirstThread = !(ppi-&gt;W32PF_Flags &amp; W32PF_THREADCONNECTED);</div>
<div class="line"><a name="l01065"></a><span class="lineno"> 1065</span>&#160;    ppi-&gt;W32PF_Flags |= W32PF_THREADCONNECTED;</div>
<div class="line"><a name="l01066"></a><span class="lineno"> 1066</span>&#160; </div>
<div class="line"><a name="l01067"></a><span class="lineno"> 1067</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01068"></a><span class="lineno"> 1068</span>&#160;<span class="comment">     * If we haven&#39;t copied over our startup info yet, do it now.</span></div>
<div class="line"><a name="l01069"></a><span class="lineno"> 1069</span>&#160;<span class="comment">     * Don&#39;t bother copying the info if we aren&#39;t going to use it.</span></div>
<div class="line"><a name="l01070"></a><span class="lineno"> 1070</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01071"></a><span class="lineno"> 1071</span>&#160;    <span class="keywordflow">if</span> (ProcessParams) {</div>
<div class="line"><a name="l01072"></a><span class="lineno"> 1072</span>&#160; </div>
<div class="line"><a name="l01073"></a><span class="lineno"> 1073</span>&#160;        pusi = &amp;ppi-&gt;<a class="code" href="a02905.html#a12f7bfd1b0c792cec2292a87a75bc8c5">usi</a>;</div>
<div class="line"><a name="l01074"></a><span class="lineno"> 1074</span>&#160; </div>
<div class="line"><a name="l01075"></a><span class="lineno"> 1075</span>&#160;        <span class="keywordflow">if</span> ((pusi-&gt;<a class="code" href="a02781.html#a9ed6a30359da8299f730bdf76bc44dbb">cb</a> == 0) &amp;&amp; (ProcessParams-&gt;WindowFlags != 0)) {</div>
<div class="line"><a name="l01076"></a><span class="lineno"> 1076</span>&#160;            pusi-&gt;<a class="code" href="a02781.html#a9ed6a30359da8299f730bdf76bc44dbb">cb</a>          = <span class="keyword">sizeof</span>(<a class="code" href="a00899.html#a77006252d3c3006452d5dc2272d7cc9a">USERSTARTUPINFO</a>);</div>
<div class="line"><a name="l01077"></a><span class="lineno"> 1077</span>&#160;            pusi-&gt;<a class="code" href="a02781.html#abbaa6dbe87da7a3d8b7480a3136f8ca8">dwX</a>         = ProcessParams-&gt;StartingX;</div>
<div class="line"><a name="l01078"></a><span class="lineno"> 1078</span>&#160;            pusi-&gt;<a class="code" href="a02781.html#a256ccde56536d6a94ba1addb6b5ee6db">dwY</a>         = ProcessParams-&gt;StartingY;</div>
<div class="line"><a name="l01079"></a><span class="lineno"> 1079</span>&#160;            pusi-&gt;<a class="code" href="a02781.html#ad850b4a870bf162d1807c31eb8353d0b">dwXSize</a>     = ProcessParams-&gt;CountX;</div>
<div class="line"><a name="l01080"></a><span class="lineno"> 1080</span>&#160;            pusi-&gt;<a class="code" href="a02781.html#ae8e1aaf0b4027957c1918bcaf3d591dd">dwYSize</a>     = ProcessParams-&gt;CountY;</div>
<div class="line"><a name="l01081"></a><span class="lineno"> 1081</span>&#160;            pusi-&gt;<a class="code" href="a02781.html#a4d2f405b1141000eb2af256e0fc8b98b">dwFlags</a>     = ProcessParams-&gt;WindowFlags;</div>
<div class="line"><a name="l01082"></a><span class="lineno"> 1082</span>&#160;            pusi-&gt;<a class="code" href="a02781.html#ab0197bf9bedcf5ad7f21808dd143e7b2">wShowWindow</a> = (WORD)ProcessParams-&gt;ShowWindowFlags;</div>
<div class="line"><a name="l01083"></a><span class="lineno"> 1083</span>&#160;        }</div>
<div class="line"><a name="l01084"></a><span class="lineno"> 1084</span>&#160; </div>
<div class="line"><a name="l01085"></a><span class="lineno"> 1085</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01086"></a><span class="lineno"> 1086</span>&#160;<span class="comment">         * Set up the hot key, if there is one.</span></div>
<div class="line"><a name="l01087"></a><span class="lineno"> 1087</span>&#160;<span class="comment">         *</span></div>
<div class="line"><a name="l01088"></a><span class="lineno"> 1088</span>&#160;<span class="comment">         * If the STARTF_USEHOTKEY flag is given in the startup info, then</span></div>
<div class="line"><a name="l01089"></a><span class="lineno"> 1089</span>&#160;<span class="comment">         * the hStdInput is the hotkey (new from Chicago).  Otherwise, parse</span></div>
<div class="line"><a name="l01090"></a><span class="lineno"> 1090</span>&#160;<span class="comment">         * it out in string format from the lpReserved string.</span></div>
<div class="line"><a name="l01091"></a><span class="lineno"> 1091</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01092"></a><span class="lineno"> 1092</span>&#160;        <span class="keywordflow">if</span> (fFirstThread) {</div>
<div class="line"><a name="l01093"></a><span class="lineno"> 1093</span>&#160; </div>
<div class="line"><a name="l01094"></a><span class="lineno"> 1094</span>&#160;            <span class="keywordflow">if</span> (ProcessParams-&gt;WindowFlags &amp; STARTF_USEHOTKEY) {</div>
<div class="line"><a name="l01095"></a><span class="lineno"> 1095</span>&#160;                ppi-&gt;<a class="code" href="a02905.html#af2dee2144e1b1c252aefa41fb6a2dc37">dwHotkey</a> = (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)ProcessParams-&gt;StandardInput;</div>
<div class="line"><a name="l01096"></a><span class="lineno"> 1096</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01097"></a><span class="lineno"> 1097</span>&#160;                ppi-&gt;<a class="code" href="a02905.html#af2dee2144e1b1c252aefa41fb6a2dc37">dwHotkey</a> = <a class="code" href="a00824.html#ada31cc49cd6c9b760343ae21f7fec29c">ParseReserved</a>(ProcessParams-&gt;ShellInfo.Buffer,</div>
<div class="line"><a name="l01098"></a><span class="lineno"> 1098</span>&#160;                                              L<span class="stringliteral">&quot;hotkey.&quot;</span>);</div>
<div class="line"><a name="l01099"></a><span class="lineno"> 1099</span>&#160;            }</div>
<div class="line"><a name="l01100"></a><span class="lineno"> 1100</span>&#160;        }</div>
<div class="line"><a name="l01101"></a><span class="lineno"> 1101</span>&#160;    }</div>
<div class="line"><a name="l01102"></a><span class="lineno"> 1102</span>&#160; </div>
<div class="line"><a name="l01103"></a><span class="lineno"> 1103</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01104"></a><span class="lineno"> 1104</span>&#160;<span class="comment">     * Open the windowstation and desktop.  If this is a system</span></div>
<div class="line"><a name="l01105"></a><span class="lineno"> 1105</span>&#160;<span class="comment">     * thread only use the desktop that might be stored in the teb.</span></div>
<div class="line"><a name="l01106"></a><span class="lineno"> 1106</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01107"></a><span class="lineno"> 1107</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a> == NULL);</div>
<div class="line"><a name="l01108"></a><span class="lineno"> 1108</span>&#160;    <span class="keywordflow">if</span> (!(pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; (TIF_SYSTEMTHREAD | TIF_CSRSSTHREAD)) &amp;&amp;</div>
<div class="line"><a name="l01109"></a><span class="lineno"> 1109</span>&#160;        (<a class="code" href="a03257.html#ad9f551216ba73947832de96844110fca">grpwinstaList</a> != NULL)) {</div>
<div class="line"><a name="l01110"></a><span class="lineno"> 1110</span>&#160; </div>
<div class="line"><a name="l01111"></a><span class="lineno"> 1111</span>&#160;        BOOL bShutDown = FALSE;</div>
<div class="line"><a name="l01112"></a><span class="lineno"> 1112</span>&#160; </div>
<div class="line"><a name="l01113"></a><span class="lineno"> 1113</span>&#160;        hdesk = <a class="code" href="a00656.html#ab6156418d7affbd264dcd2f33436a743">xxxResolveDesktop</a>(</div>
<div class="line"><a name="l01114"></a><span class="lineno"> 1114</span>&#160;                NtCurrentProcess(),</div>
<div class="line"><a name="l01115"></a><span class="lineno"> 1115</span>&#160;                &amp;ProcessParams-&gt;DesktopInfo,</div>
<div class="line"><a name="l01116"></a><span class="lineno"> 1116</span>&#160;                &amp;hwinsta, (ProcessParams-&gt;WindowFlags &amp; STARTF_DESKTOPINHERIT),</div>
<div class="line"><a name="l01117"></a><span class="lineno"> 1117</span>&#160;                &amp;bShutDown);</div>
<div class="line"><a name="l01118"></a><span class="lineno"> 1118</span>&#160; </div>
<div class="line"><a name="l01119"></a><span class="lineno"> 1119</span>&#160;        <span class="keywordflow">if</span> (hdesk == NULL) {</div>
<div class="line"><a name="l01120"></a><span class="lineno"> 1120</span>&#160; </div>
<div class="line"><a name="l01121"></a><span class="lineno"> 1121</span>&#160;            <span class="keywordflow">if</span> (bShutDown) {</div>
<div class="line"><a name="l01122"></a><span class="lineno"> 1122</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l01123"></a><span class="lineno"> 1123</span>&#160;<span class="comment">                 * Trying to create a new process during logoff</span></div>
<div class="line"><a name="l01124"></a><span class="lineno"> 1124</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l01125"></a><span class="lineno"> 1125</span>&#160; </div>
<div class="line"><a name="l01126"></a><span class="lineno"> 1126</span>&#160;                ULONG ErrorResponse;</div>
<div class="line"><a name="l01127"></a><span class="lineno"> 1127</span>&#160; </div>
<div class="line"><a name="l01128"></a><span class="lineno"> 1128</span>&#160;                <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l01129"></a><span class="lineno"> 1129</span>&#160; </div>
<div class="line"><a name="l01130"></a><span class="lineno"> 1130</span>&#160;                ExRaiseHardError((NTSTATUS)STATUS_DLL_INIT_FAILED_LOGOFF,</div>
<div class="line"><a name="l01131"></a><span class="lineno"> 1131</span>&#160;                                 0,</div>
<div class="line"><a name="l01132"></a><span class="lineno"> 1132</span>&#160;                                 0,</div>
<div class="line"><a name="l01133"></a><span class="lineno"> 1133</span>&#160;                                 NULL,</div>
<div class="line"><a name="l01134"></a><span class="lineno"> 1134</span>&#160;                                 OptionOk,</div>
<div class="line"><a name="l01135"></a><span class="lineno"> 1135</span>&#160;                                 &amp;ErrorResponse);</div>
<div class="line"><a name="l01136"></a><span class="lineno"> 1136</span>&#160; </div>
<div class="line"><a name="l01137"></a><span class="lineno"> 1137</span>&#160;                ZwTerminateProcess(NtCurrentProcess(), STATUS_DLL_INIT_FAILED);</div>
<div class="line"><a name="l01138"></a><span class="lineno"> 1138</span>&#160; </div>
<div class="line"><a name="l01139"></a><span class="lineno"> 1139</span>&#160;                <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l01140"></a><span class="lineno"> 1140</span>&#160;            }</div>
<div class="line"><a name="l01141"></a><span class="lineno"> 1141</span>&#160;            <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01142"></a><span class="lineno"> 1142</span>&#160;                Status = STATUS_DLL_INIT_FAILED;</div>
<div class="line"><a name="l01143"></a><span class="lineno"> 1143</span>&#160;                <span class="keywordflow">goto</span> CreateThreadInfoFailed;</div>
<div class="line"><a name="l01144"></a><span class="lineno"> 1144</span>&#160;            }</div>
<div class="line"><a name="l01145"></a><span class="lineno"> 1145</span>&#160; </div>
<div class="line"><a name="l01146"></a><span class="lineno"> 1146</span>&#160;            <span class="keywordflow">return</span> STATUS_DLL_INIT_FAILED;</div>
<div class="line"><a name="l01147"></a><span class="lineno"> 1147</span>&#160; </div>
<div class="line"><a name="l01148"></a><span class="lineno"> 1148</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01149"></a><span class="lineno"> 1149</span>&#160; </div>
<div class="line"><a name="l01150"></a><span class="lineno"> 1150</span>&#160;            <a class="code" href="a00899.html#a735e711fdfa2ca8337263f6799250a97">xxxSetProcessWindowStation</a>(hwinsta);</div>
<div class="line"><a name="l01151"></a><span class="lineno"> 1151</span>&#160; </div>
<div class="line"><a name="l01152"></a><span class="lineno"> 1152</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01153"></a><span class="lineno"> 1153</span>&#160;<span class="comment">             * Reference the desktop handle</span></div>
<div class="line"><a name="l01154"></a><span class="lineno"> 1154</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01155"></a><span class="lineno"> 1155</span>&#160;            Status = ObReferenceObjectByHandle(</div>
<div class="line"><a name="l01156"></a><span class="lineno"> 1156</span>&#160;                    hdesk,</div>
<div class="line"><a name="l01157"></a><span class="lineno"> 1157</span>&#160;                    0,</div>
<div class="line"><a name="l01158"></a><span class="lineno"> 1158</span>&#160;                    *<a class="code" href="a00899.html#a6b562f476cdc12794cf052fff8d41096">ExDesktopObjectType</a>,</div>
<div class="line"><a name="l01159"></a><span class="lineno"> 1159</span>&#160;                    KernelMode,</div>
<div class="line"><a name="l01160"></a><span class="lineno"> 1160</span>&#160;                    &amp;pdesk,</div>
<div class="line"><a name="l01161"></a><span class="lineno"> 1161</span>&#160;                    NULL);</div>
<div class="line"><a name="l01162"></a><span class="lineno"> 1162</span>&#160; </div>
<div class="line"><a name="l01163"></a><span class="lineno"> 1163</span>&#160;            <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l01164"></a><span class="lineno"> 1164</span>&#160;                <span class="keywordflow">goto</span> CreateThreadInfoFailed;</div>
<div class="line"><a name="l01165"></a><span class="lineno"> 1165</span>&#160;            }</div>
<div class="line"><a name="l01166"></a><span class="lineno"> 1166</span>&#160; </div>
<div class="line"><a name="l01167"></a><span class="lineno"> 1167</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01168"></a><span class="lineno"> 1168</span>&#160;<span class="comment">             * The first desktop is the default for all succeeding threads.</span></div>
<div class="line"><a name="l01169"></a><span class="lineno"> 1169</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01170"></a><span class="lineno"> 1170</span>&#160;            <span class="keywordflow">if</span> ((ppi-&gt;<a class="code" href="a02905.html#a50126c121ac5d62813a93e0a867acc51">hdeskStartup</a> == NULL) &amp;&amp;</div>
<div class="line"><a name="l01171"></a><span class="lineno"> 1171</span>&#160;                (Process-&gt;UniqueProcessId != <a class="code" href="a03257.html#ad4b0bbbb1f1fce28a4e874ae6fb92262">gpidLogon</a>)) {</div>
<div class="line"><a name="l01172"></a><span class="lineno"> 1172</span>&#160; </div>
<div class="line"><a name="l01173"></a><span class="lineno"> 1173</span>&#160;                LockDesktop(&amp;ppi-&gt;<a class="code" href="a02905.html#a28c079cebbf5a70cee9aea1d83dbd239">rpdeskStartup</a>, pdesk);</div>
<div class="line"><a name="l01174"></a><span class="lineno"> 1174</span>&#160;                ppi-&gt;<a class="code" href="a02905.html#a50126c121ac5d62813a93e0a867acc51">hdeskStartup</a> = hdesk;</div>
<div class="line"><a name="l01175"></a><span class="lineno"> 1175</span>&#160;            }</div>
<div class="line"><a name="l01176"></a><span class="lineno"> 1176</span>&#160;        }</div>
<div class="line"><a name="l01177"></a><span class="lineno"> 1177</span>&#160;    }</div>
<div class="line"><a name="l01178"></a><span class="lineno"> 1178</span>&#160; </div>
<div class="line"><a name="l01179"></a><span class="lineno"> 1179</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01180"></a><span class="lineno"> 1180</span>&#160;<span class="comment">     * Remember dwExpWinVer. This is used to return GetAppVer() (and</span></div>
<div class="line"><a name="l01181"></a><span class="lineno"> 1181</span>&#160;<span class="comment">     * GetExpWinVer(NULL).</span></div>
<div class="line"><a name="l01182"></a><span class="lineno"> 1182</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01183"></a><span class="lineno"> 1183</span>&#160;    <span class="keywordflow">if</span> (Process-&gt;Peb != NULL)</div>
<div class="line"><a name="l01184"></a><span class="lineno"> 1184</span>&#160;        pti-&gt;<a class="code" href="a02889.html#ac18617bb8bdbcb8e9c73e759b9df75eb">dwExpWinVer</a> = <a class="code" href="a00365.html#a383740f6dc1129f6127ab14fbe6b607c">RtlGetExpWinVer</a>(Process-&gt;Peb-&gt;ImageBaseAddress);</div>
<div class="line"><a name="l01185"></a><span class="lineno"> 1185</span>&#160;    <span class="keywordflow">else</span></div>
<div class="line"><a name="l01186"></a><span class="lineno"> 1186</span>&#160;        pti-&gt;<a class="code" href="a02889.html#ac18617bb8bdbcb8e9c73e759b9df75eb">dwExpWinVer</a> = VER40;</div>
<div class="line"><a name="l01187"></a><span class="lineno"> 1187</span>&#160; </div>
<div class="line"><a name="l01188"></a><span class="lineno"> 1188</span>&#160;    pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#ac18617bb8bdbcb8e9c73e759b9df75eb">dwExpWinVer</a> = pti-&gt;<a class="code" href="a02889.html#ac18617bb8bdbcb8e9c73e759b9df75eb">dwExpWinVer</a>;</div>
<div class="line"><a name="l01189"></a><span class="lineno"> 1189</span>&#160;    pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a3c509629a36511ee0d17273de6b9d6af">dwTIFlags</a>   = pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a>;</div>
<div class="line"><a name="l01190"></a><span class="lineno"> 1190</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a09237cbbe78ba3aebf853599bced5ac8">spklActive</a>) {</div>
<div class="line"><a name="l01191"></a><span class="lineno"> 1191</span>&#160;        pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a2f8155c1da5bc6033b5fb9682e01fab6">CodePage</a> = pti-&gt;<a class="code" href="a02889.html#a09237cbbe78ba3aebf853599bced5ac8">spklActive</a>-&gt;<a class="code" href="a02793.html#a2f8155c1da5bc6033b5fb9682e01fab6">CodePage</a>;</div>
<div class="line"><a name="l01192"></a><span class="lineno"> 1192</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01193"></a><span class="lineno"> 1193</span>&#160;        pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a2f8155c1da5bc6033b5fb9682e01fab6">CodePage</a> = CP_ACP;</div>
<div class="line"><a name="l01194"></a><span class="lineno"> 1194</span>&#160;    }</div>
<div class="line"><a name="l01195"></a><span class="lineno"> 1195</span>&#160; </div>
<div class="line"><a name="l01196"></a><span class="lineno"> 1196</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01197"></a><span class="lineno"> 1197</span>&#160;<span class="comment">     * Remember that this is a screen saver. That way we can set its</span></div>
<div class="line"><a name="l01198"></a><span class="lineno"> 1198</span>&#160;<span class="comment">     * priority appropriately when it is idle or when it needs to go</span></div>
<div class="line"><a name="l01199"></a><span class="lineno"> 1199</span>&#160;<span class="comment">     * away.</span></div>
<div class="line"><a name="l01200"></a><span class="lineno"> 1200</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01201"></a><span class="lineno"> 1201</span>&#160;    <span class="keywordflow">if</span> (ProcessParams &amp;&amp; ProcessParams-&gt;WindowFlags &amp; <a class="code" href="a00824.html#a6e0a0685504f087ee37b9165459b305b">STARTF_SCREENSAVER</a>) {</div>
<div class="line"><a name="l01202"></a><span class="lineno"> 1202</span>&#160;        <a class="code" href="a00686.html#ac02cf9f8e2879a07c57e42ef8f4ff885">SetForegroundPriority</a>(pti, TRUE);</div>
<div class="line"><a name="l01203"></a><span class="lineno"> 1203</span>&#160;<span class="preprocessor">#ifdef FE_IME</span></div>
<div class="line"><a name="l01204"></a><span class="lineno"> 1204</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01205"></a><span class="lineno"> 1205</span>&#160;<span class="comment">         * Screen saver doesn&#39;t need any IME processing.</span></div>
<div class="line"><a name="l01206"></a><span class="lineno"> 1206</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01207"></a><span class="lineno"> 1207</span>&#160;        pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> |= (TIF_SCREENSAVER | TIF_DISABLEIME);</div>
<div class="line"><a name="l01208"></a><span class="lineno"> 1208</span>&#160;<span class="preprocessor">#else</span></div>
<div class="line"><a name="l01209"></a><span class="lineno"> 1209</span>&#160;        pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> |= TIF_SCREENSAVER;</div>
<div class="line"><a name="l01210"></a><span class="lineno"> 1210</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l01211"></a><span class="lineno"> 1211</span>&#160;    }</div>
<div class="line"><a name="l01212"></a><span class="lineno"> 1212</span>&#160; </div>
<div class="line"><a name="l01213"></a><span class="lineno"> 1213</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01214"></a><span class="lineno"> 1214</span>&#160;<span class="comment">     * Set the desktop even if it is NULL to ensure that pti-&gt;pDeskInfo</span></div>
<div class="line"><a name="l01215"></a><span class="lineno"> 1215</span>&#160;<span class="comment">     * is set.</span></div>
<div class="line"><a name="l01216"></a><span class="lineno"> 1216</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01217"></a><span class="lineno"> 1217</span>&#160;    <a class="code" href="a00656.html#adab7753eb3b9c19ddc0f7e5218d350fc">SetDesktop</a>(pti, pdesk, hdesk);</div>
<div class="line"><a name="l01218"></a><span class="lineno"> 1218</span>&#160; </div>
<div class="line"><a name="l01219"></a><span class="lineno"> 1219</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01220"></a><span class="lineno"> 1220</span>&#160;<span class="comment">     * Do special processing for the first thread of a process.</span></div>
<div class="line"><a name="l01221"></a><span class="lineno"> 1221</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01222"></a><span class="lineno"> 1222</span>&#160;    <span class="keywordflow">if</span> (!(pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; (TIF_SYSTEMTHREAD | TIF_CSRSSTHREAD))) {</div>
<div class="line"><a name="l01223"></a><span class="lineno"> 1223</span>&#160; </div>
<div class="line"><a name="l01224"></a><span class="lineno"> 1224</span>&#160;        <span class="keywordflow">if</span> (fFirstThread) {</div>
<div class="line"><a name="l01225"></a><span class="lineno"> 1225</span>&#160; </div>
<div class="line"><a name="l01226"></a><span class="lineno"> 1226</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01227"></a><span class="lineno"> 1227</span>&#160;<span class="comment">             * Setup public classes. Classes are only unregistered at process</span></div>
<div class="line"><a name="l01228"></a><span class="lineno"> 1228</span>&#160;<span class="comment">             * cleanup time. If a process exists but has only one gui thread</span></div>
<div class="line"><a name="l01229"></a><span class="lineno"> 1229</span>&#160;<span class="comment">             * that it creates and destroys, we&#39;d continually execute through</span></div>
<div class="line"><a name="l01230"></a><span class="lineno"> 1230</span>&#160;<span class="comment">             * this cThreads == 1 code path. So make sure anything we allocate</span></div>
<div class="line"><a name="l01231"></a><span class="lineno"> 1231</span>&#160;<span class="comment">             * here only gets allocated once.</span></div>
<div class="line"><a name="l01232"></a><span class="lineno"> 1232</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01233"></a><span class="lineno"> 1233</span>&#160;            <span class="keywordflow">if</span> (!(ppi-&gt;W32PF_Flags &amp; W32PF_CLASSESREGISTERED)) {</div>
<div class="line"><a name="l01234"></a><span class="lineno"> 1234</span>&#160;                ppi-&gt;W32PF_Flags |= W32PF_CLASSESREGISTERED;</div>
<div class="line"><a name="l01235"></a><span class="lineno"> 1235</span>&#160;                <a class="code" href="a00719.html#aede6de42e849405c86466f41e45e6fbd">LW_RegisterWindows</a>(FALSE);</div>
<div class="line"><a name="l01236"></a><span class="lineno"> 1236</span>&#160;            }</div>
<div class="line"><a name="l01237"></a><span class="lineno"> 1237</span>&#160; </div>
<div class="line"><a name="l01238"></a><span class="lineno"> 1238</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01239"></a><span class="lineno"> 1239</span>&#160;<span class="comment">             * If this is an application starting (ie. not some thread of</span></div>
<div class="line"><a name="l01240"></a><span class="lineno"> 1240</span>&#160;<span class="comment">             * the server context), enable the app-starting cursor.</span></div>
<div class="line"><a name="l01241"></a><span class="lineno"> 1241</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01242"></a><span class="lineno"> 1242</span>&#160;            <a class="code" href="a00824.html#a38b809c615e10eca863b213d461e7040">CalcStartCursorHide</a>((PW32PROCESS)Process-&gt;Win32Process, 5000);</div>
<div class="line"><a name="l01243"></a><span class="lineno"> 1243</span>&#160; </div>
<div class="line"><a name="l01244"></a><span class="lineno"> 1244</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01245"></a><span class="lineno"> 1245</span>&#160;<span class="comment">             * Open the windowstation</span></div>
<div class="line"><a name="l01246"></a><span class="lineno"> 1246</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01247"></a><span class="lineno"> 1247</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a03257.html#ad9f551216ba73947832de96844110fca">grpwinstaList</a> &amp;&amp; ppi-&gt;<a class="code" href="a02905.html#a1899acfa354d8b3a6a8e69f7a1f781af">rpwinsta</a> == NULL) {</div>
<div class="line"><a name="l01248"></a><span class="lineno"> 1248</span>&#160;                <a class="code" href="a00371.html#ae61d954062a9ece52e350e54cad9a23d">RIPERR0</a>(ERROR_CAN_NOT_COMPLETE, <a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;System is not initialized\n&quot;</span>);</div>
<div class="line"><a name="l01249"></a><span class="lineno"> 1249</span>&#160;                Status = STATUS_UNSUCCESSFUL;</div>
<div class="line"><a name="l01250"></a><span class="lineno"> 1250</span>&#160;                <span class="keywordflow">goto</span> CreateThreadInfoFailed;</div>
<div class="line"><a name="l01251"></a><span class="lineno"> 1251</span>&#160;            }</div>
<div class="line"><a name="l01252"></a><span class="lineno"> 1252</span>&#160;        }</div>
<div class="line"><a name="l01253"></a><span class="lineno"> 1253</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01254"></a><span class="lineno"> 1254</span>&#160; </div>
<div class="line"><a name="l01255"></a><span class="lineno"> 1255</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01256"></a><span class="lineno"> 1256</span>&#160;<span class="comment">         * Don&#39;t register system windows until cursors and icons</span></div>
<div class="line"><a name="l01257"></a><span class="lineno"> 1257</span>&#160;<span class="comment">         * have been loaded.</span></div>
<div class="line"><a name="l01258"></a><span class="lineno"> 1258</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01259"></a><span class="lineno"> 1259</span>&#160;        <span class="keywordflow">if</span> ((SYSCUR(ARROW) != NULL) &amp;&amp;</div>
<div class="line"><a name="l01260"></a><span class="lineno"> 1260</span>&#160;            !(ppi-&gt;W32PF_Flags &amp; W32PF_CLASSESREGISTERED)) {</div>
<div class="line"><a name="l01261"></a><span class="lineno"> 1261</span>&#160; </div>
<div class="line"><a name="l01262"></a><span class="lineno"> 1262</span>&#160;            ppi-&gt;W32PF_Flags |= W32PF_CLASSESREGISTERED;</div>
<div class="line"><a name="l01263"></a><span class="lineno"> 1263</span>&#160;            <a class="code" href="a00719.html#aede6de42e849405c86466f41e45e6fbd">LW_RegisterWindows</a>(pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SYSTEMTHREAD);</div>
<div class="line"><a name="l01264"></a><span class="lineno"> 1264</span>&#160;        }</div>
<div class="line"><a name="l01265"></a><span class="lineno"> 1265</span>&#160;    }</div>
<div class="line"><a name="l01266"></a><span class="lineno"> 1266</span>&#160; </div>
<div class="line"><a name="l01267"></a><span class="lineno"> 1267</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01268"></a><span class="lineno"> 1268</span>&#160;<span class="comment">     * If we have a desktop and are journalling on that desktop, use</span></div>
<div class="line"><a name="l01269"></a><span class="lineno"> 1269</span>&#160;<span class="comment">     * the journal queue, otherwise create a new queue.</span></div>
<div class="line"><a name="l01270"></a><span class="lineno"> 1270</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01271"></a><span class="lineno"> 1271</span>&#160;    <span class="keywordflow">if</span> (!(pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_DONTATTACHQUEUE) &amp;&amp;</div>
<div class="line"><a name="l01272"></a><span class="lineno"> 1272</span>&#160;        (pdesk != NULL)                         &amp;&amp;</div>
<div class="line"><a name="l01273"></a><span class="lineno"> 1273</span>&#160;        (pdesk == <a class="code" href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a>)              &amp;&amp;</div>
<div class="line"><a name="l01274"></a><span class="lineno"> 1274</span>&#160;        (pdesk-&gt;<a class="code" href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a313ccee64c6b84cf38149cd97f7e4442">fsHooks</a> &amp;</div>
<div class="line"><a name="l01275"></a><span class="lineno"> 1275</span>&#160;            (WHF_JOURNALPLAYBACK | WHF_JOURNALRECORD))) {</div>
<div class="line"><a name="l01276"></a><span class="lineno"> 1276</span>&#160; </div>
<div class="line"><a name="l01277"></a><span class="lineno"> 1277</span>&#160;        <a class="code" href="a02889.html">PTHREADINFO</a> ptiT;</div>
<div class="line"><a name="l01278"></a><span class="lineno"> 1278</span>&#160; </div>
<div class="line"><a name="l01279"></a><span class="lineno"> 1279</span>&#160;        <span class="keywordflow">if</span> (pdesk-&gt;<a class="code" href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a90cb8c3bf2c119d721de439c1e18733b">asphkStart</a>[WH_JOURNALPLAYBACK + 1] != NULL) {</div>
<div class="line"><a name="l01280"></a><span class="lineno"> 1280</span>&#160;            ptiT = GETPTI(pdesk-&gt;<a class="code" href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a90cb8c3bf2c119d721de439c1e18733b">asphkStart</a>[WH_JOURNALPLAYBACK + 1]);</div>
<div class="line"><a name="l01281"></a><span class="lineno"> 1281</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01282"></a><span class="lineno"> 1282</span>&#160;            ptiT = GETPTI(pdesk-&gt;<a class="code" href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a90cb8c3bf2c119d721de439c1e18733b">asphkStart</a>[WH_JOURNALRECORD + 1]);</div>
<div class="line"><a name="l01283"></a><span class="lineno"> 1283</span>&#160;        }</div>
<div class="line"><a name="l01284"></a><span class="lineno"> 1284</span>&#160; </div>
<div class="line"><a name="l01285"></a><span class="lineno"> 1285</span>&#160;        pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a> = ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>;</div>
<div class="line"><a name="l01286"></a><span class="lineno"> 1286</span>&#160;        pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a>++;</div>
<div class="line"><a name="l01287"></a><span class="lineno"> 1287</span>&#160; </div>
<div class="line"><a name="l01288"></a><span class="lineno"> 1288</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01289"></a><span class="lineno"> 1289</span>&#160; </div>
<div class="line"><a name="l01290"></a><span class="lineno"> 1290</span>&#160;        <span class="keywordflow">if</span> ((pq = <a class="code" href="a00824.html#a44b46f3a89833f8c52a823637e5f5021">AllocQueue</a>(NULL, NULL)) == NULL) {</div>
<div class="line"><a name="l01291"></a><span class="lineno"> 1291</span>&#160;            Status = STATUS_NO_MEMORY;</div>
<div class="line"><a name="l01292"></a><span class="lineno"> 1292</span>&#160;            <span class="keywordflow">goto</span> CreateThreadInfoFailed;</div>
<div class="line"><a name="l01293"></a><span class="lineno"> 1293</span>&#160;        }</div>
<div class="line"><a name="l01294"></a><span class="lineno"> 1294</span>&#160; </div>
<div class="line"><a name="l01295"></a><span class="lineno"> 1295</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01296"></a><span class="lineno"> 1296</span>&#160;<span class="comment">         * Attach the Q to the THREADINFO.</span></div>
<div class="line"><a name="l01297"></a><span class="lineno"> 1297</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01298"></a><span class="lineno"> 1298</span>&#160;        pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>      = pq;</div>
<div class="line"><a name="l01299"></a><span class="lineno"> 1299</span>&#160;        pq-&gt;<a class="code" href="a02869.html#ab38e745019cf5314eea3e78229d367c3">ptiMouse</a> = pq-&gt;<a class="code" href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">ptiKeyboard</a> = pti;</div>
<div class="line"><a name="l01300"></a><span class="lineno"> 1300</span>&#160;        pq-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a>++;</div>
<div class="line"><a name="l01301"></a><span class="lineno"> 1301</span>&#160;    }</div>
<div class="line"><a name="l01302"></a><span class="lineno"> 1302</span>&#160; </div>
<div class="line"><a name="l01303"></a><span class="lineno"> 1303</span>&#160; </div>
<div class="line"><a name="l01304"></a><span class="lineno"> 1304</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01305"></a><span class="lineno"> 1305</span>&#160;<span class="comment">     * Initialize hung timer value</span></div>
<div class="line"><a name="l01306"></a><span class="lineno"> 1306</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01307"></a><span class="lineno"> 1307</span>&#160; </div>
<div class="line"><a name="l01308"></a><span class="lineno"> 1308</span>&#160;    SET_TIME_LAST_READ(pti);</div>
<div class="line"><a name="l01309"></a><span class="lineno"> 1309</span>&#160; </div>
<div class="line"><a name="l01310"></a><span class="lineno"> 1310</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01311"></a><span class="lineno"> 1311</span>&#160;<span class="comment">     * If someone is waiting on this process propagate that info into</span></div>
<div class="line"><a name="l01312"></a><span class="lineno"> 1312</span>&#160;<span class="comment">     * the thread info</span></div>
<div class="line"><a name="l01313"></a><span class="lineno"> 1313</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01314"></a><span class="lineno"> 1314</span>&#160;    <span class="keywordflow">if</span> (ppi-&gt;W32PF_Flags &amp; W32PF_WAITFORINPUTIDLE)</div>
<div class="line"><a name="l01315"></a><span class="lineno"> 1315</span>&#160;        pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> |= TIF_WAITFORINPUTIDLE;</div>
<div class="line"><a name="l01316"></a><span class="lineno"> 1316</span>&#160; </div>
<div class="line"><a name="l01317"></a><span class="lineno"> 1317</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01318"></a><span class="lineno"> 1318</span>&#160;<span class="comment">     * Mark the thread as initialized.</span></div>
<div class="line"><a name="l01319"></a><span class="lineno"> 1319</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01320"></a><span class="lineno"> 1320</span>&#160;    pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> |= TIF_GUITHREADINITIALIZED;</div>
<div class="line"><a name="l01321"></a><span class="lineno"> 1321</span>&#160; </div>
<div class="line"><a name="l01322"></a><span class="lineno"> 1322</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01323"></a><span class="lineno"> 1323</span>&#160;<span class="comment">     * Allow the thread to come to foreground when it is created</span></div>
<div class="line"><a name="l01324"></a><span class="lineno"> 1324</span>&#160;<span class="comment">     * if the current process is the foreground process.</span></div>
<div class="line"><a name="l01325"></a><span class="lineno"> 1325</span>&#160;<span class="comment">     * This Flag is a hack to fix Bug 28502.  When we click on</span></div>
<div class="line"><a name="l01326"></a><span class="lineno"> 1326</span>&#160;<span class="comment">     * &quot;Map Network Drive&quot; button on the toolbar, the explorer (Bobday)</span></div>
<div class="line"><a name="l01327"></a><span class="lineno"> 1327</span>&#160;<span class="comment">     * creates another thread to create the dialog box. This will create</span></div>
<div class="line"><a name="l01328"></a><span class="lineno"> 1328</span>&#160;<span class="comment">     * the dialog in the background. We are adding this fix at the request</span></div>
<div class="line"><a name="l01329"></a><span class="lineno"> 1329</span>&#160;<span class="comment">     * of the Shell team so that this dialog comes up as foreground.</span></div>
<div class="line"><a name="l01330"></a><span class="lineno"> 1330</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01331"></a><span class="lineno"> 1331</span>&#160;     <span class="keywordflow">if</span>( (<a class="code" href="a03257.html#a72d6c69b0eefb30311d982761970b971">gptiForeground</a>) &amp;&amp; (ppi == <a class="code" href="a03257.html#a72d6c69b0eefb30311d982761970b971">gptiForeground</a>-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>) ) {</div>
<div class="line"><a name="l01332"></a><span class="lineno"> 1332</span>&#160;         pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> |= TIF_ALLOWFOREGROUNDACTIVATE;</div>
<div class="line"><a name="l01333"></a><span class="lineno"> 1333</span>&#160;     }</div>
<div class="line"><a name="l01334"></a><span class="lineno"> 1334</span>&#160; </div>
<div class="line"><a name="l01335"></a><span class="lineno"> 1335</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01336"></a><span class="lineno"> 1336</span>&#160;<span class="comment">     * Call back to the client to finish initialization.</span></div>
<div class="line"><a name="l01337"></a><span class="lineno"> 1337</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01338"></a><span class="lineno"> 1338</span>&#160;    <span class="keywordflow">if</span> (!(dwTIFlags &amp; (TIF_SYSTEMTHREAD | TIF_CSRSSTHREAD))) {</div>
<div class="line"><a name="l01339"></a><span class="lineno"> 1339</span>&#160; </div>
<div class="line"><a name="l01340"></a><span class="lineno"> 1340</span>&#160;        <a class="code" href="a00824.html#a2b2ac38b234d1daf66fd52ba7ddf27fc">SetAppCompatFlags</a>(pti);</div>
<div class="line"><a name="l01341"></a><span class="lineno"> 1341</span>&#160; </div>
<div class="line"><a name="l01342"></a><span class="lineno"> 1342</span>&#160;        Status = <a class="code" href="a00035.html#a53b9632eb283c87e1b7ac76a5408de7e">ClientThreadSetup</a>();</div>
<div class="line"><a name="l01343"></a><span class="lineno"> 1343</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l01344"></a><span class="lineno"> 1344</span>&#160;            <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;ClientThreadSetup failed&quot;</span>);</div>
<div class="line"><a name="l01345"></a><span class="lineno"> 1345</span>&#160;            <span class="keywordflow">goto</span> CreateThreadInfoFailed;</div>
<div class="line"><a name="l01346"></a><span class="lineno"> 1346</span>&#160;        }</div>
<div class="line"><a name="l01347"></a><span class="lineno"> 1347</span>&#160;    }</div>
<div class="line"><a name="l01348"></a><span class="lineno"> 1348</span>&#160; </div>
<div class="line"><a name="l01349"></a><span class="lineno"> 1349</span>&#160;    <span class="keywordflow">if</span> ((NT_SUCCESS(Status) &amp;&amp; fFirstThread) &amp;&amp;</div>
<div class="line"><a name="l01350"></a><span class="lineno"> 1350</span>&#160;        !(ppi-&gt;W32PF_Flags &amp; W32PF_CONSOLEAPPLICATION)) {</div>
<div class="line"><a name="l01351"></a><span class="lineno"> 1351</span>&#160; </div>
<div class="line"><a name="l01352"></a><span class="lineno"> 1352</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01353"></a><span class="lineno"> 1353</span>&#160;<span class="comment">         * Don&#39;t play the sound for console processes</span></div>
<div class="line"><a name="l01354"></a><span class="lineno"> 1354</span>&#160;<span class="comment">         * since we will play it when the console window</span></div>
<div class="line"><a name="l01355"></a><span class="lineno"> 1355</span>&#160;<span class="comment">         * will be created</span></div>
<div class="line"><a name="l01356"></a><span class="lineno"> 1356</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01357"></a><span class="lineno"> 1357</span>&#160;        <a class="code" href="a03605.html#aa3b0c33e20363be2ffa1cd10a3d54342">xxxPlayEventSound</a>(L<span class="stringliteral">&quot;Open&quot;</span>);</div>
<div class="line"><a name="l01358"></a><span class="lineno"> 1358</span>&#160;    }</div>
<div class="line"><a name="l01359"></a><span class="lineno"> 1359</span>&#160; </div>
<div class="line"><a name="l01360"></a><span class="lineno"> 1360</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01361"></a><span class="lineno"> 1361</span>&#160;<span class="comment">     * Release desktop.</span></div>
<div class="line"><a name="l01362"></a><span class="lineno"> 1362</span>&#160;<span class="comment">     * Some other thread might have been waiting to destroy this desktop</span></div>
<div class="line"><a name="l01363"></a><span class="lineno"> 1363</span>&#160;<span class="comment">     *  when xxxResolveDestktop got a handle to it. So let&#39;s double</span></div>
<div class="line"><a name="l01364"></a><span class="lineno"> 1364</span>&#160;<span class="comment">     *  check this now that we have called back several times after getting</span></div>
<div class="line"><a name="l01365"></a><span class="lineno"> 1365</span>&#160;<span class="comment">     *  the handle back.</span></div>
<div class="line"><a name="l01366"></a><span class="lineno"> 1366</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01367"></a><span class="lineno"> 1367</span>&#160;    <span class="keywordflow">if</span> (pdesk != NULL) {</div>
<div class="line"><a name="l01368"></a><span class="lineno"> 1368</span>&#160;        <span class="keywordflow">if</span> (pdesk-&gt;<a class="code" href="a02801.html#a3f38a65f805623b272c560a777329069">dwDTFlags</a> &amp; DF_DESTROYED) {</div>
<div class="line"><a name="l01369"></a><span class="lineno"> 1369</span>&#160;            <a class="code" href="a00371.html#a31aafffb49dfe98bdc749c9b35c90162">RIPMSG1</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;xxxCreateThreadInfo: pdesk destroyed:%#lx&quot;</span>, pdesk);</div>
<div class="line"><a name="l01370"></a><span class="lineno"> 1370</span>&#160;            Status = STATUS_UNSUCCESSFUL;</div>
<div class="line"><a name="l01371"></a><span class="lineno"> 1371</span>&#160;            <span class="keywordflow">goto</span> CreateThreadInfoFailed;</div>
<div class="line"><a name="l01372"></a><span class="lineno"> 1372</span>&#160;        }</div>
<div class="line"><a name="l01373"></a><span class="lineno"> 1373</span>&#160;        ObDereferenceObject(pdesk);</div>
<div class="line"><a name="l01374"></a><span class="lineno"> 1374</span>&#160;    }</div>
<div class="line"><a name="l01375"></a><span class="lineno"> 1375</span>&#160; </div>
<div class="line"><a name="l01376"></a><span class="lineno"> 1376</span>&#160;    <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l01377"></a><span class="lineno"> 1377</span>&#160; </div>
<div class="line"><a name="l01378"></a><span class="lineno"> 1378</span>&#160;CreateThreadInfoFailed:</div>
<div class="line"><a name="l01379"></a><span class="lineno"> 1379</span>&#160;    <span class="keywordflow">if</span> (pdesk != NULL) {</div>
<div class="line"><a name="l01380"></a><span class="lineno"> 1380</span>&#160;        ObDereferenceObject(pdesk);</div>
<div class="line"><a name="l01381"></a><span class="lineno"> 1381</span>&#160;    }</div>
<div class="line"><a name="l01382"></a><span class="lineno"> 1382</span>&#160;    <a class="code" href="a00824.html#ae1fd296dfef25f7afb5e44ece42b1bf3">xxxDestroyThreadInfo</a>();</div>
<div class="line"><a name="l01383"></a><span class="lineno"> 1383</span>&#160;    <a class="code" href="a00824.html#a73f8ccc884e465b0ab2f729c70791cc1">DeleteThreadInfo</a>(pti);</div>
<div class="line"><a name="l01384"></a><span class="lineno"> 1384</span>&#160;    <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l01385"></a><span class="lineno"> 1385</span>&#160;}</div>
<div class="line"><a name="l01386"></a><span class="lineno"> 1386</span>&#160; </div>
<div class="line"><a name="l01387"></a><span class="lineno"> 1387</span>&#160; </div>
<div class="line"><a name="l01388"></a><span class="lineno"> 1388</span>&#160; </div>
<div class="line"><a name="l01399"></a><span class="lineno"><a class="line" href="a00899.html#aaaaa7f6d36d78194eebe2e8346ed4047"> 1399</a></span>&#160;<a class="code" href="a02869.html">PQ</a> <a class="code" href="a00824.html#a44b46f3a89833f8c52a823637e5f5021">AllocQueue</a>(</div>
<div class="line"><a name="l01400"></a><span class="lineno"> 1400</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiKeyState,    <span class="comment">// if non-Null then use this key state</span></div>
<div class="line"><a name="l01401"></a><span class="lineno"> 1401</span>&#160;                                <span class="comment">// other wise use global AsyncKeyState</span></div>
<div class="line"><a name="l01402"></a><span class="lineno"> 1402</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq)                      <span class="comment">// non-null == preallocated object</span></div>
<div class="line"><a name="l01403"></a><span class="lineno"> 1403</span>&#160;{</div>
<div class="line"><a name="l01404"></a><span class="lineno"> 1404</span>&#160;    <span class="keywordtype">int</span>    i;</div>
<div class="line"><a name="l01405"></a><span class="lineno"> 1405</span>&#160;    USHORT cLockCount;</div>
<div class="line"><a name="l01406"></a><span class="lineno"> 1406</span>&#160; </div>
<div class="line"><a name="l01407"></a><span class="lineno"> 1407</span>&#160;    <span class="keywordflow">if</span> (pq == NULL) {</div>
<div class="line"><a name="l01408"></a><span class="lineno"> 1408</span>&#160;        <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code" href="a00824.html#a1310cfa8277987ec1f39ab190577eb4c">QUEUE_ENTRIES</a>; i++) {</div>
<div class="line"><a name="l01409"></a><span class="lineno"> 1409</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a00824.html#a5f4680255099c975e7786c45b1124304">QueueFreeList</a>[i] != NULL) {</div>
<div class="line"><a name="l01410"></a><span class="lineno"> 1410</span>&#160;                pq = <a class="code" href="a00824.html#a5f4680255099c975e7786c45b1124304">QueueFreeList</a>[i];</div>
<div class="line"><a name="l01411"></a><span class="lineno"> 1411</span>&#160;                <a class="code" href="a00824.html#a5f4680255099c975e7786c45b1124304">QueueFreeList</a>[i] = NULL;</div>
<div class="line"><a name="l01412"></a><span class="lineno"> 1412</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l01413"></a><span class="lineno"> 1413</span>&#160;            }</div>
<div class="line"><a name="l01414"></a><span class="lineno"> 1414</span>&#160;        }</div>
<div class="line"><a name="l01415"></a><span class="lineno"> 1415</span>&#160;        <span class="keywordflow">if</span> (pq == NULL) {</div>
<div class="line"><a name="l01416"></a><span class="lineno"> 1416</span>&#160;            pq = UserAllocPool(<span class="keyword">sizeof</span>(<a class="code" href="a02869.html">Q</a>), TAG_Q);</div>
<div class="line"><a name="l01417"></a><span class="lineno"> 1417</span>&#160;            <span class="keywordflow">if</span> (pq == NULL) {</div>
<div class="line"><a name="l01418"></a><span class="lineno"> 1418</span>&#160;                <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l01419"></a><span class="lineno"> 1419</span>&#160;            }</div>
<div class="line"><a name="l01420"></a><span class="lineno"> 1420</span>&#160;        }</div>
<div class="line"><a name="l01421"></a><span class="lineno"> 1421</span>&#160;        cLockCount = 0;</div>
<div class="line"><a name="l01422"></a><span class="lineno"> 1422</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01423"></a><span class="lineno"> 1423</span>&#160;        <a class="code" href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">DebugValidateMLIST</a>(&amp;pq-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>);</div>
<div class="line"><a name="l01424"></a><span class="lineno"> 1424</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01425"></a><span class="lineno"> 1425</span>&#160;<span class="comment">         * Preserve lock count.</span></div>
<div class="line"><a name="l01426"></a><span class="lineno"> 1426</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01427"></a><span class="lineno"> 1427</span>&#160;        cLockCount = pq-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a>;</div>
<div class="line"><a name="l01428"></a><span class="lineno"> 1428</span>&#160;    }</div>
<div class="line"><a name="l01429"></a><span class="lineno"> 1429</span>&#160;    RtlZeroMemory(pq, <span class="keyword">sizeof</span>(<a class="code" href="a02869.html">Q</a>));</div>
<div class="line"><a name="l01430"></a><span class="lineno"> 1430</span>&#160;    pq-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a> = cLockCount;</div>
<div class="line"><a name="l01431"></a><span class="lineno"> 1431</span>&#160; </div>
<div class="line"><a name="l01432"></a><span class="lineno"> 1432</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01433"></a><span class="lineno"> 1433</span>&#160;<span class="comment">     * This is a new queue; we need to update its key state table before</span></div>
<div class="line"><a name="l01434"></a><span class="lineno"> 1434</span>&#160;<span class="comment">     * the first input event is put in the queue.</span></div>
<div class="line"><a name="l01435"></a><span class="lineno"> 1435</span>&#160;<span class="comment">     * We do this by copying the current keystate table and NULLing the recent</span></div>
<div class="line"><a name="l01436"></a><span class="lineno"> 1436</span>&#160;<span class="comment">     * down state table.  If a key is really down it will be updated when</span></div>
<div class="line"><a name="l01437"></a><span class="lineno"> 1437</span>&#160;<span class="comment">     * we get it repeats.</span></div>
<div class="line"><a name="l01438"></a><span class="lineno"> 1438</span>&#160;<span class="comment">     *</span></div>
<div class="line"><a name="l01439"></a><span class="lineno"> 1439</span>&#160;<span class="comment">     * He is the old way that did not work because if the first key was say an</span></div>
<div class="line"><a name="l01440"></a><span class="lineno"> 1440</span>&#160;<span class="comment">     * alt key the Async table would be updated, then the UpdateKeyState</span></div>
<div class="line"><a name="l01441"></a><span class="lineno"> 1441</span>&#160;<span class="comment">     * message and it would look like the alt key was PREVIOUSLY down.</span></div>
<div class="line"><a name="l01442"></a><span class="lineno"> 1442</span>&#160;<span class="comment">     *</span></div>
<div class="line"><a name="l01443"></a><span class="lineno"> 1443</span>&#160;<span class="comment">     * The queue will get updated when it first reads input: to allow the</span></div>
<div class="line"><a name="l01444"></a><span class="lineno"> 1444</span>&#160;<span class="comment">     * app to query the key state before it calls GetMessage, set its initial</span></div>
<div class="line"><a name="l01445"></a><span class="lineno"> 1445</span>&#160;<span class="comment">     * key state to the asynchronous key state.</span></div>
<div class="line"><a name="l01446"></a><span class="lineno"> 1446</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01447"></a><span class="lineno"> 1447</span>&#160;    <span class="keywordflow">if</span> (ptiKeyState) {</div>
<div class="line"><a name="l01448"></a><span class="lineno"> 1448</span>&#160;        RtlCopyMemory(pq-&gt;<a class="code" href="a02869.html#ab34627c4e06a3d5e23b559df878ba497">afKeyState</a>, ptiKeyState-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#ab34627c4e06a3d5e23b559df878ba497">afKeyState</a>, CBKEYSTATE);</div>
<div class="line"><a name="l01449"></a><span class="lineno"> 1449</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01450"></a><span class="lineno"> 1450</span>&#160;        RtlCopyMemory(pq-&gt;<a class="code" href="a02869.html#ab34627c4e06a3d5e23b559df878ba497">afKeyState</a>, <a class="code" href="a03257.html#a400c45d213332277ff223c8c26996f88">gafAsyncKeyState</a>, CBKEYSTATE);</div>
<div class="line"><a name="l01451"></a><span class="lineno"> 1451</span>&#160;    }</div>
<div class="line"><a name="l01452"></a><span class="lineno"> 1452</span>&#160; </div>
<div class="line"><a name="l01453"></a><span class="lineno"> 1453</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01454"></a><span class="lineno"> 1454</span>&#160;<span class="comment">     * If there isn&#39;t a mouse set iCursorLevel to -1 so the</span></div>
<div class="line"><a name="l01455"></a><span class="lineno"> 1455</span>&#160;<span class="comment">     * mouse cursor won&#39;t be visible on the screen.</span></div>
<div class="line"><a name="l01456"></a><span class="lineno"> 1456</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01457"></a><span class="lineno"> 1457</span>&#160;    <span class="keywordflow">if</span> (!oemInfo.fMouse) {</div>
<div class="line"><a name="l01458"></a><span class="lineno"> 1458</span>&#160;        pq-&gt;<a class="code" href="a02869.html#a97845e5f321fb758821ac99bd53840de">iCursorLevel</a>--;</div>
<div class="line"><a name="l01459"></a><span class="lineno"> 1459</span>&#160;    }</div>
<div class="line"><a name="l01460"></a><span class="lineno"> 1460</span>&#160; </div>
<div class="line"><a name="l01461"></a><span class="lineno"> 1461</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01462"></a><span class="lineno"> 1462</span>&#160;<span class="comment">     * While the thread is starting up...  it has the wait cursor.</span></div>
<div class="line"><a name="l01463"></a><span class="lineno"> 1463</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01464"></a><span class="lineno"> 1464</span>&#160;    <a class="code" href="a00638.html#a439658ba5849cd209ffc346d05cb508b">LockQCursor</a>(pq, SYSCUR(WAIT));</div>
<div class="line"><a name="l01465"></a><span class="lineno"> 1465</span>&#160; </div>
<div class="line"><a name="l01466"></a><span class="lineno"> 1466</span>&#160;    <a class="code" href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">DebugValidateMLIST</a>(&amp;pq-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>);</div>
<div class="line"><a name="l01467"></a><span class="lineno"> 1467</span>&#160;    <span class="keywordflow">return</span> pq;</div>
<div class="line"><a name="l01468"></a><span class="lineno"> 1468</span>&#160;}</div>
<div class="line"><a name="l01469"></a><span class="lineno"> 1469</span>&#160; </div>
<div class="line"><a name="l01470"></a><span class="lineno"> 1470</span>&#160; </div>
<div class="line"><a name="l01475"></a><span class="lineno"><a class="line" href="a00824.html#a6234fc19d7c15559264915103e34035d"> 1475</a></span>&#160;VOID <a class="code" href="a00824.html#a6234fc19d7c15559264915103e34035d">FreeQueue</a>(</div>
<div class="line"><a name="l01476"></a><span class="lineno"> 1476</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq)</div>
<div class="line"><a name="l01477"></a><span class="lineno"> 1477</span>&#160;{</div>
<div class="line"><a name="l01478"></a><span class="lineno"> 1478</span>&#160;    <span class="keywordtype">int</span> i;</div>
<div class="line"><a name="l01479"></a><span class="lineno"> 1479</span>&#160; </div>
<div class="line"><a name="l01480"></a><span class="lineno"> 1480</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l01481"></a><span class="lineno"> 1481</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01482"></a><span class="lineno"> 1482</span>&#160;<span class="comment">     * Turn off the flag indicating that this queue is in destruction.</span></div>
<div class="line"><a name="l01483"></a><span class="lineno"> 1483</span>&#160;<span class="comment">     * We do this in either case that we are putting this into the free</span></div>
<div class="line"><a name="l01484"></a><span class="lineno"> 1484</span>&#160;<span class="comment">     * list, or truly destroying the handle.  We use this to try and</span></div>
<div class="line"><a name="l01485"></a><span class="lineno"> 1485</span>&#160;<span class="comment">     * track cases where someone tries to lock elements into the queue</span></div>
<div class="line"><a name="l01486"></a><span class="lineno"> 1486</span>&#160;<span class="comment">     * structure while it&#39;s going through destuction.</span></div>
<div class="line"><a name="l01487"></a><span class="lineno"> 1487</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01488"></a><span class="lineno"> 1488</span>&#160;    pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> &amp;= ~QF_INDESTROY;</div>
<div class="line"><a name="l01489"></a><span class="lineno"> 1489</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l01490"></a><span class="lineno"> 1490</span>&#160; </div>
<div class="line"><a name="l01491"></a><span class="lineno"> 1491</span>&#160;    <span class="keywordflow">for</span> (i = 0; i &lt; <a class="code" href="a00824.html#a1310cfa8277987ec1f39ab190577eb4c">QUEUE_ENTRIES</a>; i++) {</div>
<div class="line"><a name="l01492"></a><span class="lineno"> 1492</span>&#160; </div>
<div class="line"><a name="l01493"></a><span class="lineno"> 1493</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="a00824.html#a5f4680255099c975e7786c45b1124304">QueueFreeList</a>[i] == NULL) {</div>
<div class="line"><a name="l01494"></a><span class="lineno"> 1494</span>&#160; </div>
<div class="line"><a name="l01495"></a><span class="lineno"> 1495</span>&#160;            <a class="code" href="a00824.html#a5f4680255099c975e7786c45b1124304">QueueFreeList</a>[i] = pq;</div>
<div class="line"><a name="l01496"></a><span class="lineno"> 1496</span>&#160; </div>
<div class="line"><a name="l01497"></a><span class="lineno"> 1497</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l01498"></a><span class="lineno"> 1498</span>&#160;        }</div>
<div class="line"><a name="l01499"></a><span class="lineno"> 1499</span>&#160;    }</div>
<div class="line"><a name="l01500"></a><span class="lineno"> 1500</span>&#160; </div>
<div class="line"><a name="l01501"></a><span class="lineno"> 1501</span>&#160;    UserFreePool(pq);</div>
<div class="line"><a name="l01502"></a><span class="lineno"> 1502</span>&#160;}</div>
<div class="line"><a name="l01503"></a><span class="lineno"> 1503</span>&#160; </div>
<div class="line"><a name="l01511"></a><span class="lineno"><a class="line" href="a00899.html#aeafdb7a2066a7b9a1c036e2db4ca0f35"> 1511</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#aeafdb7a2066a7b9a1c036e2db4ca0f35">DestroyQueue</a>(</div>
<div class="line"><a name="l01512"></a><span class="lineno"> 1512</span>&#160;    <a class="code" href="a02869.html">PQ</a>          pq,</div>
<div class="line"><a name="l01513"></a><span class="lineno"> 1513</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti)</div>
<div class="line"><a name="l01514"></a><span class="lineno"> 1514</span>&#160;{</div>
<div class="line"><a name="l01515"></a><span class="lineno"> 1515</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiT;</div>
<div class="line"><a name="l01516"></a><span class="lineno"> 1516</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiAny, ptiBestMouse, ptiBestKey;</div>
<div class="line"><a name="l01517"></a><span class="lineno"> 1517</span>&#160;    PLIST_ENTRY pHead, pEntry;</div>
<div class="line"><a name="l01518"></a><span class="lineno"> 1518</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l01519"></a><span class="lineno"> 1519</span>&#160;    USHORT cDying = 0;</div>
<div class="line"><a name="l01520"></a><span class="lineno"> 1520</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l01521"></a><span class="lineno"> 1521</span>&#160; </div>
<div class="line"><a name="l01522"></a><span class="lineno"> 1522</span>&#160;    <a class="code" href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">DebugValidateMLIST</a>(&amp;pq-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>);</div>
<div class="line"><a name="l01523"></a><span class="lineno"> 1523</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pq-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a>);</div>
<div class="line"><a name="l01524"></a><span class="lineno"> 1524</span>&#160;    pq-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a>--;</div>
<div class="line"><a name="l01525"></a><span class="lineno"> 1525</span>&#160; </div>
<div class="line"><a name="l01526"></a><span class="lineno"> 1526</span>&#160;    <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a> != 0) {</div>
<div class="line"><a name="l01527"></a><span class="lineno"> 1527</span>&#160; </div>
<div class="line"><a name="l01528"></a><span class="lineno"> 1528</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01529"></a><span class="lineno"> 1529</span>&#160;<span class="comment">         * Since we aren&#39;t going to destroy this queue, make sure</span></div>
<div class="line"><a name="l01530"></a><span class="lineno"> 1530</span>&#160;<span class="comment">         * it isn&#39;t pointing to the THREADINFO that&#39;s going away.</span></div>
<div class="line"><a name="l01531"></a><span class="lineno"> 1531</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01532"></a><span class="lineno"> 1532</span>&#160;        <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a> == pti) {</div>
<div class="line"><a name="l01533"></a><span class="lineno"> 1533</span>&#160;            <a class="code" href="a00899.html#a1e8f3de1ac479af792360b59a0a80bc7">CheckSysLock</a>(6, pq, NULL);</div>
<div class="line"><a name="l01534"></a><span class="lineno"> 1534</span>&#160;            pq-&gt;<a class="code" href="a02869.html#a9c78a46a532787c63a126570d8a56680">ptiSysLock</a> = NULL;</div>
<div class="line"><a name="l01535"></a><span class="lineno"> 1535</span>&#160;        }</div>
<div class="line"><a name="l01536"></a><span class="lineno"> 1536</span>&#160; </div>
<div class="line"><a name="l01537"></a><span class="lineno"> 1537</span>&#160;        <span class="keywordflow">if</span> ((pq-&gt;<a class="code" href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">ptiKeyboard</a> == pti) || (pq-&gt;<a class="code" href="a02869.html#ab38e745019cf5314eea3e78229d367c3">ptiMouse</a> == pti)) {</div>
<div class="line"><a name="l01538"></a><span class="lineno"> 1538</span>&#160; </div>
<div class="line"><a name="l01539"></a><span class="lineno"> 1539</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01540"></a><span class="lineno"> 1540</span>&#160;<span class="comment">             * Run through THREADINFOs looking for one pointing to pq.</span></div>
<div class="line"><a name="l01541"></a><span class="lineno"> 1541</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01542"></a><span class="lineno"> 1542</span>&#160;            ptiAny = NULL;</div>
<div class="line"><a name="l01543"></a><span class="lineno"> 1543</span>&#160;            ptiBestMouse = NULL;</div>
<div class="line"><a name="l01544"></a><span class="lineno"> 1544</span>&#160;            ptiBestKey = NULL;</div>
<div class="line"><a name="l01545"></a><span class="lineno"> 1545</span>&#160; </div>
<div class="line"><a name="l01546"></a><span class="lineno"> 1546</span>&#160;            pHead = &amp;pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>-&gt;<a class="code" href="a02801.html#a2e665ea3941bf02f8d89deaebca7b0e4">PtiList</a>;</div>
<div class="line"><a name="l01547"></a><span class="lineno"> 1547</span>&#160;            <span class="keywordflow">for</span> (pEntry = pHead-&gt;Flink; pEntry != pHead; pEntry = pEntry-&gt;Flink) {</div>
<div class="line"><a name="l01548"></a><span class="lineno"> 1548</span>&#160;                ptiT = CONTAINING_RECORD(pEntry, <a class="code" href="a02889.html">THREADINFO</a>, PtiLink);</div>
<div class="line"><a name="l01549"></a><span class="lineno"> 1549</span>&#160; </div>
<div class="line"><a name="l01550"></a><span class="lineno"> 1550</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l01551"></a><span class="lineno"> 1551</span>&#160;<span class="comment">                 * Skip threads that are going away or belong to a</span></div>
<div class="line"><a name="l01552"></a><span class="lineno"> 1552</span>&#160;<span class="comment">                 * different queue.</span></div>
<div class="line"><a name="l01553"></a><span class="lineno"> 1553</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l01554"></a><span class="lineno"> 1554</span>&#160;                <span class="keywordflow">if</span> ((ptiT-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_INCLEANUP) || (ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a> != pq)) {</div>
<div class="line"><a name="l01555"></a><span class="lineno"> 1555</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l01556"></a><span class="lineno"> 1556</span>&#160;                    <span class="keywordflow">if</span> (ptiT-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a> == pq &amp;&amp; (ptiT-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_INCLEANUP))</div>
<div class="line"><a name="l01557"></a><span class="lineno"> 1557</span>&#160;                        cDying++;</div>
<div class="line"><a name="l01558"></a><span class="lineno"> 1558</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l01559"></a><span class="lineno"> 1559</span>&#160;                    <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l01560"></a><span class="lineno"> 1560</span>&#160;                }</div>
<div class="line"><a name="l01561"></a><span class="lineno"> 1561</span>&#160; </div>
<div class="line"><a name="l01562"></a><span class="lineno"> 1562</span>&#160;                ptiAny = ptiT;</div>
<div class="line"><a name="l01563"></a><span class="lineno"> 1563</span>&#160; </div>
<div class="line"><a name="l01564"></a><span class="lineno"> 1564</span>&#160;                <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp; QS_MOUSE) {</div>
<div class="line"><a name="l01565"></a><span class="lineno"> 1565</span>&#160;                    <span class="keywordflow">if</span> (ptiT-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#aa1082b32678ff0e6f4d076c83458e1ca">fsWakeMask</a> &amp; QS_MOUSE)</div>
<div class="line"><a name="l01566"></a><span class="lineno"> 1566</span>&#160;                        ptiBestMouse = ptiT;</div>
<div class="line"><a name="l01567"></a><span class="lineno"> 1567</span>&#160;                }</div>
<div class="line"><a name="l01568"></a><span class="lineno"> 1568</span>&#160; </div>
<div class="line"><a name="l01569"></a><span class="lineno"> 1569</span>&#160;                <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp; QS_KEY) {</div>
<div class="line"><a name="l01570"></a><span class="lineno"> 1570</span>&#160;                    <span class="keywordflow">if</span> (ptiT-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#aa1082b32678ff0e6f4d076c83458e1ca">fsWakeMask</a> &amp; QS_KEY)</div>
<div class="line"><a name="l01571"></a><span class="lineno"> 1571</span>&#160;                        ptiBestKey = ptiT;</div>
<div class="line"><a name="l01572"></a><span class="lineno"> 1572</span>&#160;                }</div>
<div class="line"><a name="l01573"></a><span class="lineno"> 1573</span>&#160;            }</div>
<div class="line"><a name="l01574"></a><span class="lineno"> 1574</span>&#160; </div>
<div class="line"><a name="l01575"></a><span class="lineno"> 1575</span>&#160;            <span class="keywordflow">if</span> (ptiBestMouse == NULL)</div>
<div class="line"><a name="l01576"></a><span class="lineno"> 1576</span>&#160;                ptiBestMouse = ptiAny;</div>
<div class="line"><a name="l01577"></a><span class="lineno"> 1577</span>&#160;            <span class="keywordflow">if</span> (ptiBestKey == NULL)</div>
<div class="line"><a name="l01578"></a><span class="lineno"> 1578</span>&#160;                ptiBestKey = ptiAny;</div>
<div class="line"><a name="l01579"></a><span class="lineno"> 1579</span>&#160; </div>
<div class="line"><a name="l01580"></a><span class="lineno"> 1580</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01581"></a><span class="lineno"> 1581</span>&#160;<span class="comment">             * Transfer any wake-bits to this new queue.  This</span></div>
<div class="line"><a name="l01582"></a><span class="lineno"> 1582</span>&#160;<span class="comment">             * is a common problem for QS_MOUSEMOVE which doesn&#39;t</span></div>
<div class="line"><a name="l01583"></a><span class="lineno"> 1583</span>&#160;<span class="comment">             * get set on coalesced WM_MOUSEMOVE events, so we</span></div>
<div class="line"><a name="l01584"></a><span class="lineno"> 1584</span>&#160;<span class="comment">             * need to make sure the new thread tries to process</span></div>
<div class="line"><a name="l01585"></a><span class="lineno"> 1585</span>&#160;<span class="comment">             * any input waiting in the queue.</span></div>
<div class="line"><a name="l01586"></a><span class="lineno"> 1586</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01587"></a><span class="lineno"> 1587</span>&#160;            <span class="keywordflow">if</span> (ptiBestMouse != NULL)</div>
<div class="line"><a name="l01588"></a><span class="lineno"> 1588</span>&#160;                <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(ptiBestMouse, pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp; QS_MOUSE);</div>
<div class="line"><a name="l01589"></a><span class="lineno"> 1589</span>&#160;            <span class="keywordflow">if</span> (ptiBestKey != NULL)</div>
<div class="line"><a name="l01590"></a><span class="lineno"> 1590</span>&#160;                <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(ptiBestKey, pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp; QS_KEY);</div>
<div class="line"><a name="l01591"></a><span class="lineno"> 1591</span>&#160; </div>
<div class="line"><a name="l01592"></a><span class="lineno"> 1592</span>&#160;            <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">ptiKeyboard</a> == pti)</div>
<div class="line"><a name="l01593"></a><span class="lineno"> 1593</span>&#160;                pq-&gt;<a class="code" href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">ptiKeyboard</a> = ptiBestKey;</div>
<div class="line"><a name="l01594"></a><span class="lineno"> 1594</span>&#160; </div>
<div class="line"><a name="l01595"></a><span class="lineno"> 1595</span>&#160;            <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#ab38e745019cf5314eea3e78229d367c3">ptiMouse</a> == pti)</div>
<div class="line"><a name="l01596"></a><span class="lineno"> 1596</span>&#160;                pq-&gt;<a class="code" href="a02869.html#ab38e745019cf5314eea3e78229d367c3">ptiMouse</a> = ptiBestMouse;</div>
<div class="line"><a name="l01597"></a><span class="lineno"> 1597</span>&#160; </div>
<div class="line"><a name="l01598"></a><span class="lineno"> 1598</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l01599"></a><span class="lineno"> 1599</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01600"></a><span class="lineno"> 1600</span>&#160;<span class="comment">             * Bad things happen if ptiKeyboard or ptiMouse are NULL</span></div>
<div class="line"><a name="l01601"></a><span class="lineno"> 1601</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01602"></a><span class="lineno"> 1602</span>&#160;            <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a> != cDying &amp;&amp; (pq-&gt;<a class="code" href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">ptiKeyboard</a> == NULL || pq-&gt;<a class="code" href="a02869.html#ab38e745019cf5314eea3e78229d367c3">ptiMouse</a> == NULL)) {</div>
<div class="line"><a name="l01603"></a><span class="lineno"> 1603</span>&#160; </div>
<div class="line"><a name="l01604"></a><span class="lineno"> 1604</span>&#160;                KdPrint((<span class="stringliteral">&quot;pq %lx pq-&gt;cThreads %x cDying %x pti %lx ptiK %lx ptiM %lx\n&quot;</span>,</div>
<div class="line"><a name="l01605"></a><span class="lineno"> 1605</span>&#160;                    pq, pq-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a>, cDying, pti, pq-&gt;<a class="code" href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">ptiKeyboard</a>, pq-&gt;<a class="code" href="a02869.html#ab38e745019cf5314eea3e78229d367c3">ptiMouse</a>));</div>
<div class="line"><a name="l01606"></a><span class="lineno"> 1606</span>&#160;                <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(0);</div>
<div class="line"><a name="l01607"></a><span class="lineno"> 1607</span>&#160;            }</div>
<div class="line"><a name="l01608"></a><span class="lineno"> 1608</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l01609"></a><span class="lineno"> 1609</span>&#160;        }</div>
<div class="line"><a name="l01610"></a><span class="lineno"> 1610</span>&#160; </div>
<div class="line"><a name="l01611"></a><span class="lineno"> 1611</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l01612"></a><span class="lineno"> 1612</span>&#160;    }</div>
<div class="line"><a name="l01613"></a><span class="lineno"> 1613</span>&#160; </div>
<div class="line"><a name="l01614"></a><span class="lineno"> 1614</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01615"></a><span class="lineno"> 1615</span>&#160;<span class="comment">     * Unlock any potentially locked globals now that we know absolutely</span></div>
<div class="line"><a name="l01616"></a><span class="lineno"> 1616</span>&#160;<span class="comment">     * that this queue is going away.</span></div>
<div class="line"><a name="l01617"></a><span class="lineno"> 1617</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01618"></a><span class="lineno"> 1618</span>&#160;    Unlock(&amp;pq-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a>);</div>
<div class="line"><a name="l01619"></a><span class="lineno"> 1619</span>&#160;    Unlock(&amp;pq-&gt;<a class="code" href="a02869.html#aa187e19d8d7e6018ddfbe3aaa9156240">spwndFocus</a>);</div>
<div class="line"><a name="l01620"></a><span class="lineno"> 1620</span>&#160;    Unlock(&amp;pq-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>);</div>
<div class="line"><a name="l01621"></a><span class="lineno"> 1621</span>&#160;    Unlock(&amp;pq-&gt;<a class="code" href="a02869.html#a950fb049dd2c207bcda1f2a2c3912cc9">spwndActivePrev</a>);</div>
<div class="line"><a name="l01622"></a><span class="lineno"> 1622</span>&#160;    Unlock(&amp;pq-&gt;<a class="code" href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">spwndLastMouseMessage</a>);</div>
<div class="line"><a name="l01623"></a><span class="lineno"> 1623</span>&#160;    Unlock(&amp;pq-&gt;<a class="code" href="a02869.html#ade15a80896abdba1533b909440c29699">caret</a>.<a class="code" href="a02653.html#a68937d60a6f49b7a8431db62b38ea721">spwnd</a>);</div>
<div class="line"><a name="l01624"></a><span class="lineno"> 1624</span>&#160;    <a class="code" href="a00638.html#a439658ba5849cd209ffc346d05cb508b">LockQCursor</a>(pq, NULL);</div>
<div class="line"><a name="l01625"></a><span class="lineno"> 1625</span>&#160; </div>
<div class="line"><a name="l01626"></a><span class="lineno"> 1626</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l01627"></a><span class="lineno"> 1627</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01628"></a><span class="lineno"> 1628</span>&#160;<span class="comment">     * Mark this queue as being in the destruction process.  This is</span></div>
<div class="line"><a name="l01629"></a><span class="lineno"> 1629</span>&#160;<span class="comment">     * cleared in FreeQueue() once we have determined it&#39;s safe to</span></div>
<div class="line"><a name="l01630"></a><span class="lineno"> 1630</span>&#160;<span class="comment">     * place in the free-list, or destroy the handle.  We use this</span></div>
<div class="line"><a name="l01631"></a><span class="lineno"> 1631</span>&#160;<span class="comment">     * to track cases where someone will lock a cursor into the queue</span></div>
<div class="line"><a name="l01632"></a><span class="lineno"> 1632</span>&#160;<span class="comment">     * while it&#39;s in the middle of being destroyed.</span></div>
<div class="line"><a name="l01633"></a><span class="lineno"> 1633</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01634"></a><span class="lineno"> 1634</span>&#160;    pq-&gt;<a class="code" href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">QF_flags</a> |= QF_INDESTROY;</div>
<div class="line"><a name="l01635"></a><span class="lineno"> 1635</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l01636"></a><span class="lineno"> 1636</span>&#160; </div>
<div class="line"><a name="l01637"></a><span class="lineno"> 1637</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01638"></a><span class="lineno"> 1638</span>&#160;<span class="comment">     * If an alt-tab window is left, it needs to be destroyed.  Because</span></div>
<div class="line"><a name="l01639"></a><span class="lineno"> 1639</span>&#160;<span class="comment">     * this may not be the thread that owns the window, we cannot</span></div>
<div class="line"><a name="l01640"></a><span class="lineno"> 1640</span>&#160;<span class="comment">     * directly destroy the window.  Post a WM_CLOSE instead.  Note that</span></div>
<div class="line"><a name="l01641"></a><span class="lineno"> 1641</span>&#160;<span class="comment">     * this situation can occur during queue attachment if more than</span></div>
<div class="line"><a name="l01642"></a><span class="lineno"> 1642</span>&#160;<span class="comment">     * one alt-tab window exists.</span></div>
<div class="line"><a name="l01643"></a><span class="lineno"> 1643</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01644"></a><span class="lineno"> 1644</span>&#160;    <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#af0a73901f2264cfe048d588810333935">spwndAltTab</a> != NULL) {</div>
<div class="line"><a name="l01645"></a><span class="lineno"> 1645</span>&#160; </div>
<div class="line"><a name="l01646"></a><span class="lineno"> 1646</span>&#160;        <a class="code" href="a02581.html">PWND</a> pwndT = pq-&gt;<a class="code" href="a02869.html#af0a73901f2264cfe048d588810333935">spwndAltTab</a>;</div>
<div class="line"><a name="l01647"></a><span class="lineno"> 1647</span>&#160; </div>
<div class="line"><a name="l01648"></a><span class="lineno"> 1648</span>&#160;        <span class="keywordflow">if</span> (Lock(&amp;pq-&gt;<a class="code" href="a02869.html#af0a73901f2264cfe048d588810333935">spwndAltTab</a>, NULL))</div>
<div class="line"><a name="l01649"></a><span class="lineno"> 1649</span>&#160;            <a class="code" href="a00257.html#a933a4a4818762a03428fe021dd9772a4">_PostMessage</a>(pwndT, WM_CLOSE, 0, 0);</div>
<div class="line"><a name="l01650"></a><span class="lineno"> 1650</span>&#160;    }</div>
<div class="line"><a name="l01651"></a><span class="lineno"> 1651</span>&#160; </div>
<div class="line"><a name="l01652"></a><span class="lineno"> 1652</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01653"></a><span class="lineno"> 1653</span>&#160;<span class="comment">     * Free everything else that was allocated/created by AllocQueue.</span></div>
<div class="line"><a name="l01654"></a><span class="lineno"> 1654</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01655"></a><span class="lineno"> 1655</span>&#160;    <a class="code" href="a00824.html#a7a86c4e19f6b63c35d8b33b891a400c9">FreeMessageList</a>(&amp;pq-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>);</div>
<div class="line"><a name="l01656"></a><span class="lineno"> 1656</span>&#160; </div>
<div class="line"><a name="l01657"></a><span class="lineno"> 1657</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01658"></a><span class="lineno"> 1658</span>&#160;<span class="comment">     * If this queue is in the foreground, set gpqForeground</span></div>
<div class="line"><a name="l01659"></a><span class="lineno"> 1659</span>&#160;<span class="comment">     * to NULL so no input is routed.  At some point we&#39;ll want</span></div>
<div class="line"><a name="l01660"></a><span class="lineno"> 1660</span>&#160;<span class="comment">     * to do slightly more clever assignment of gpqForeground here.</span></div>
<div class="line"><a name="l01661"></a><span class="lineno"> 1661</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01662"></a><span class="lineno"> 1662</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a> == pq) {</div>
<div class="line"><a name="l01663"></a><span class="lineno"> 1663</span>&#160;        <a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a> = NULL;</div>
<div class="line"><a name="l01664"></a><span class="lineno"> 1664</span>&#160;    }</div>
<div class="line"><a name="l01665"></a><span class="lineno"> 1665</span>&#160; </div>
<div class="line"><a name="l01666"></a><span class="lineno"> 1666</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#aaa5057517c2d0fcd47d29d0ab50cc111">gpqForegroundPrev</a> == pq) {</div>
<div class="line"><a name="l01667"></a><span class="lineno"> 1667</span>&#160;        <a class="code" href="a03257.html#aaa5057517c2d0fcd47d29d0ab50cc111">gpqForegroundPrev</a> = NULL;</div>
<div class="line"><a name="l01668"></a><span class="lineno"> 1668</span>&#160;    }</div>
<div class="line"><a name="l01669"></a><span class="lineno"> 1669</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a106fec4487922d9baa52acc8bfee1c07">gpqCursor</a> == pq) {</div>
<div class="line"><a name="l01670"></a><span class="lineno"> 1670</span>&#160;        <a class="code" href="a03257.html#a106fec4487922d9baa52acc8bfee1c07">gpqCursor</a> = NULL;</div>
<div class="line"><a name="l01671"></a><span class="lineno"> 1671</span>&#160;        <a class="code" href="a03290.html#a67abc9d7678097e0d7225e4af7f7973d">SetFMouseMoved</a>();</div>
<div class="line"><a name="l01672"></a><span class="lineno"> 1672</span>&#160;    }</div>
<div class="line"><a name="l01673"></a><span class="lineno"> 1673</span>&#160; </div>
<div class="line"><a name="l01674"></a><span class="lineno"> 1674</span>&#160;    <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a> == 0) {</div>
<div class="line"><a name="l01675"></a><span class="lineno"> 1675</span>&#160;        <a class="code" href="a00824.html#a6234fc19d7c15559264915103e34035d">FreeQueue</a>(pq);</div>
<div class="line"><a name="l01676"></a><span class="lineno"> 1676</span>&#160;    }</div>
<div class="line"><a name="l01677"></a><span class="lineno"> 1677</span>&#160;}</div>
<div class="line"><a name="l01678"></a><span class="lineno"> 1678</span>&#160; </div>
<div class="line"><a name="l01679"></a><span class="lineno"> 1679</span>&#160; </div>
<div class="line"><a name="l01693"></a><span class="lineno"><a class="line" href="a00899.html#a73f8ccc884e465b0ab2f729c70791cc1"> 1693</a></span>&#160;VOID <a class="code" href="a00824.html#a73f8ccc884e465b0ab2f729c70791cc1">DeleteThreadInfo</a> (<a class="code" href="a02889.html">PTHREADINFO</a> pti)</div>
<div class="line"><a name="l01694"></a><span class="lineno"> 1694</span>&#160;{</div>
<div class="line"><a name="l01695"></a><span class="lineno"> 1695</span>&#160;    CheckCritIn();</div>
<div class="line"><a name="l01696"></a><span class="lineno"> 1696</span>&#160; </div>
<div class="line"><a name="l01697"></a><span class="lineno"> 1697</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01698"></a><span class="lineno"> 1698</span>&#160;<span class="comment">     * Events</span></div>
<div class="line"><a name="l01699"></a><span class="lineno"> 1699</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01700"></a><span class="lineno"> 1700</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a64da47920250096684c62e566c661139">pEventQueueServer</a> != NULL) {</div>
<div class="line"><a name="l01701"></a><span class="lineno"> 1701</span>&#160;        ObDereferenceObject(pti-&gt;<a class="code" href="a02889.html#a64da47920250096684c62e566c661139">pEventQueueServer</a>);</div>
<div class="line"><a name="l01702"></a><span class="lineno"> 1702</span>&#160;    }</div>
<div class="line"><a name="l01703"></a><span class="lineno"> 1703</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aa96b1486618d15fb0b653be689092c8e">apEvent</a> != NULL) {</div>
<div class="line"><a name="l01704"></a><span class="lineno"> 1704</span>&#160;        ExFreePool(pti-&gt;<a class="code" href="a02889.html#aa96b1486618d15fb0b653be689092c8e">apEvent</a>);</div>
<div class="line"><a name="l01705"></a><span class="lineno"> 1705</span>&#160;    }</div>
<div class="line"><a name="l01706"></a><span class="lineno"> 1706</span>&#160; </div>
<div class="line"><a name="l01707"></a><span class="lineno"> 1707</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01708"></a><span class="lineno"> 1708</span>&#160;<span class="comment">     * App name.</span></div>
<div class="line"><a name="l01709"></a><span class="lineno"> 1709</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01710"></a><span class="lineno"> 1710</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a> != NULL) {</div>
<div class="line"><a name="l01711"></a><span class="lineno"> 1711</span>&#160;        UserFreePool(pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a>);</div>
<div class="line"><a name="l01712"></a><span class="lineno"> 1712</span>&#160;    }</div>
<div class="line"><a name="l01713"></a><span class="lineno"> 1713</span>&#160; </div>
<div class="line"><a name="l01714"></a><span class="lineno"> 1714</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01715"></a><span class="lineno"> 1715</span>&#160;<span class="comment">     * Unlock the queues and free them if no one is using them</span></div>
<div class="line"><a name="l01716"></a><span class="lineno"> 1716</span>&#160;<span class="comment">     * (the queues were already destroyed in DestroyThreadInfo)</span></div>
<div class="line"><a name="l01717"></a><span class="lineno"> 1717</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01718"></a><span class="lineno"> 1718</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a> != NULL) {</div>
<div class="line"><a name="l01719"></a><span class="lineno"> 1719</span>&#160; </div>
<div class="line"><a name="l01720"></a><span class="lineno"> 1720</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a>);</div>
<div class="line"><a name="l01721"></a><span class="lineno"> 1721</span>&#160;        --(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a>);</div>
<div class="line"><a name="l01722"></a><span class="lineno"> 1722</span>&#160; </div>
<div class="line"><a name="l01723"></a><span class="lineno"> 1723</span>&#160;        <span class="keywordflow">if</span> ((pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a> == 0)</div>
<div class="line"><a name="l01724"></a><span class="lineno"> 1724</span>&#160;                &amp;&amp; (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a> == 0)) {</div>
<div class="line"><a name="l01725"></a><span class="lineno"> 1725</span>&#160;            <a class="code" href="a00824.html#a6234fc19d7c15559264915103e34035d">FreeQueue</a>(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>);</div>
<div class="line"><a name="l01726"></a><span class="lineno"> 1726</span>&#160;        }</div>
<div class="line"><a name="l01727"></a><span class="lineno"> 1727</span>&#160; </div>
<div class="line"><a name="l01728"></a><span class="lineno"> 1728</span>&#160;    }</div>
<div class="line"><a name="l01729"></a><span class="lineno"> 1729</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a> != NULL) {</div>
<div class="line"><a name="l01730"></a><span class="lineno"> 1730</span>&#160; </div>
<div class="line"><a name="l01731"></a><span class="lineno"> 1731</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a>-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a>);</div>
<div class="line"><a name="l01732"></a><span class="lineno"> 1732</span>&#160;        --(pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a>-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a>);</div>
<div class="line"><a name="l01733"></a><span class="lineno"> 1733</span>&#160; </div>
<div class="line"><a name="l01734"></a><span class="lineno"> 1734</span>&#160;        <span class="keywordflow">if</span> ((pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a>-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a> == 0)</div>
<div class="line"><a name="l01735"></a><span class="lineno"> 1735</span>&#160;                &amp;&amp; (pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a>-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a> == 0)) {</div>
<div class="line"><a name="l01736"></a><span class="lineno"> 1736</span>&#160;            <a class="code" href="a00824.html#a6234fc19d7c15559264915103e34035d">FreeQueue</a>(pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a>);</div>
<div class="line"><a name="l01737"></a><span class="lineno"> 1737</span>&#160;        }</div>
<div class="line"><a name="l01738"></a><span class="lineno"> 1738</span>&#160; </div>
<div class="line"><a name="l01739"></a><span class="lineno"> 1739</span>&#160;    }</div>
<div class="line"><a name="l01740"></a><span class="lineno"> 1740</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01741"></a><span class="lineno"> 1741</span>&#160;<span class="comment">     * Unlock the desktop (pti already unlinked from ptiList)</span></div>
<div class="line"><a name="l01742"></a><span class="lineno"> 1742</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01743"></a><span class="lineno"> 1743</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a> != NULL) {</div>
<div class="line"><a name="l01744"></a><span class="lineno"> 1744</span>&#160;        UnlockDesktop(&amp;pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>);</div>
<div class="line"><a name="l01745"></a><span class="lineno"> 1745</span>&#160;    }</div>
<div class="line"><a name="l01746"></a><span class="lineno"> 1746</span>&#160;}</div>
<div class="line"><a name="l01747"></a><span class="lineno"> 1747</span>&#160; </div>
<div class="line"><a name="l01748"></a><span class="lineno"> 1748</span>&#160; </div>
<div class="line"><a name="l01766"></a><span class="lineno"><a class="line" href="a00899.html#ae1fd296dfef25f7afb5e44ece42b1bf3"> 1766</a></span>&#160;VOID <a class="code" href="a00824.html#ae1fd296dfef25f7afb5e44ece42b1bf3">xxxDestroyThreadInfo</a>(VOID)</div>
<div class="line"><a name="l01767"></a><span class="lineno"> 1767</span>&#160;{</div>
<div class="line"><a name="l01768"></a><span class="lineno"> 1768</span>&#160;    <a class="code" href="a02873.html">PATTACHINFO</a> *ppai;</div>
<div class="line"><a name="l01769"></a><span class="lineno"> 1769</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l01770"></a><span class="lineno"> 1770</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> *ppti;</div>
<div class="line"><a name="l01771"></a><span class="lineno"> 1771</span>&#160;    <a class="code" href="a02801.html">PDESKTOP</a> rpdesk;</div>
<div class="line"><a name="l01772"></a><span class="lineno"> 1772</span>&#160;    <a class="code" href="a02809.html">PWINDOWSTATION</a> pwinsta;</div>
<div class="line"><a name="l01773"></a><span class="lineno"> 1773</span>&#160;    <a class="code" href="a02913.html">PBWL</a> pbwl, pbwlNext;</div>
<div class="line"><a name="l01774"></a><span class="lineno"> 1774</span>&#160; </div>
<div class="line"><a name="l01775"></a><span class="lineno"> 1775</span>&#160;    pti = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l01776"></a><span class="lineno"> 1776</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a> (pti != NULL);</div>
<div class="line"><a name="l01777"></a><span class="lineno"> 1777</span>&#160; </div>
<div class="line"><a name="l01778"></a><span class="lineno"> 1778</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01779"></a><span class="lineno"> 1779</span>&#160;<span class="comment">     * Make sure that this thread is not using a client desktop.  This</span></div>
<div class="line"><a name="l01780"></a><span class="lineno"> 1780</span>&#160;<span class="comment">     * should never happen because this CSR request threads are the</span></div>
<div class="line"><a name="l01781"></a><span class="lineno"> 1781</span>&#160;<span class="comment">     * only ones that use this field and the death of a request thread</span></div>
<div class="line"><a name="l01782"></a><span class="lineno"> 1782</span>&#160;<span class="comment">     * is a fatal condition.</span></div>
<div class="line"><a name="l01783"></a><span class="lineno"> 1783</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01784"></a><span class="lineno"> 1784</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l01785"></a><span class="lineno"> 1785</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_CSRSSTHREAD)</div>
<div class="line"><a name="l01786"></a><span class="lineno"> 1786</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a> == NULL);</div>
<div class="line"><a name="l01787"></a><span class="lineno"> 1787</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l01788"></a><span class="lineno"> 1788</span>&#160; </div>
<div class="line"><a name="l01789"></a><span class="lineno"> 1789</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01790"></a><span class="lineno"> 1790</span>&#160;<span class="comment">     * Don&#39;t mess with this pti anymore.</span></div>
<div class="line"><a name="l01791"></a><span class="lineno"> 1791</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01792"></a><span class="lineno"> 1792</span>&#160;    pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> |= TIF_DONTATTACHQUEUE;</div>
<div class="line"><a name="l01793"></a><span class="lineno"> 1793</span>&#160; </div>
<div class="line"><a name="l01794"></a><span class="lineno"> 1794</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01795"></a><span class="lineno"> 1795</span>&#160;<span class="comment">     * If this thread terminated abnormally and was tracking tell</span></div>
<div class="line"><a name="l01796"></a><span class="lineno"> 1796</span>&#160;<span class="comment">     * GDI to hide the trackrect.</span></div>
<div class="line"><a name="l01797"></a><span class="lineno"> 1797</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01798"></a><span class="lineno"> 1798</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a1f6c6f6552be63e92bb242568771ee14">pmsd</a> != NULL) {</div>
<div class="line"><a name="l01799"></a><span class="lineno"> 1799</span>&#160;        <a class="code" href="a00800.html#a57923c8b89fbaf4b400d75e67ad9e2dd">xxxCancelTrackingForThread</a>(pti);</div>
<div class="line"><a name="l01800"></a><span class="lineno"> 1800</span>&#160;    }</div>
<div class="line"><a name="l01801"></a><span class="lineno"> 1801</span>&#160; </div>
<div class="line"><a name="l01802"></a><span class="lineno"> 1802</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01803"></a><span class="lineno"> 1803</span>&#160;<span class="comment">     * Unlock the pmsd window.</span></div>
<div class="line"><a name="l01804"></a><span class="lineno"> 1804</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01805"></a><span class="lineno"> 1805</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a1f6c6f6552be63e92bb242568771ee14">pmsd</a> != NULL) {</div>
<div class="line"><a name="l01806"></a><span class="lineno"> 1806</span>&#160;        Unlock(&amp;pti-&gt;<a class="code" href="a02889.html#a1f6c6f6552be63e92bb242568771ee14">pmsd</a>-&gt;<a class="code" href="a02861.html#a68937d60a6f49b7a8431db62b38ea721">spwnd</a>);</div>
<div class="line"><a name="l01807"></a><span class="lineno"> 1807</span>&#160;        UserFreePool(pti-&gt;<a class="code" href="a02889.html#a1f6c6f6552be63e92bb242568771ee14">pmsd</a>);</div>
<div class="line"><a name="l01808"></a><span class="lineno"> 1808</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a1f6c6f6552be63e92bb242568771ee14">pmsd</a> = NULL;</div>
<div class="line"><a name="l01809"></a><span class="lineno"> 1809</span>&#160;    }</div>
<div class="line"><a name="l01810"></a><span class="lineno"> 1810</span>&#160; </div>
<div class="line"><a name="l01811"></a><span class="lineno"> 1811</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01812"></a><span class="lineno"> 1812</span>&#160;<span class="comment">     * First do any preparation work: windows need to be &quot;patched&quot; so that</span></div>
<div class="line"><a name="l01813"></a><span class="lineno"> 1813</span>&#160;<span class="comment">     * their window procs point to server only windowprocs, for example.</span></div>
<div class="line"><a name="l01814"></a><span class="lineno"> 1814</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01815"></a><span class="lineno"> 1815</span>&#160;    <a class="code" href="a00635.html#a4f173f306a71eba0d461cdcea18a804d">PatchThreadWindows</a>(pti);</div>
<div class="line"><a name="l01816"></a><span class="lineno"> 1816</span>&#160; </div>
<div class="line"><a name="l01817"></a><span class="lineno"> 1817</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01818"></a><span class="lineno"> 1818</span>&#160;<span class="comment">     * Free the clipboard if owned by this thread</span></div>
<div class="line"><a name="l01819"></a><span class="lineno"> 1819</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01820"></a><span class="lineno"> 1820</span>&#160;    pwinsta = <a class="code" href="a00899.html#a792b9004a4d313da382f9a9fd8b5c1aa">_GetProcessWindowStation</a>(NULL);</div>
<div class="line"><a name="l01821"></a><span class="lineno"> 1821</span>&#160;    <span class="keywordflow">if</span> (pwinsta &amp;&amp; pwinsta-&gt;<a class="code" href="a02809.html#af2ad5f95e3f52f893a679de169114d40">ptiClipLock</a> == pti) {</div>
<div class="line"><a name="l01822"></a><span class="lineno"> 1822</span>&#160;        <a class="code" href="a00632.html#adb86eff45b43742749df3cabd77d63c4">xxxCloseClipboard</a>(pwinsta);</div>
<div class="line"><a name="l01823"></a><span class="lineno"> 1823</span>&#160;    }</div>
<div class="line"><a name="l01824"></a><span class="lineno"> 1824</span>&#160; </div>
<div class="line"><a name="l01825"></a><span class="lineno"> 1825</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01826"></a><span class="lineno"> 1826</span>&#160;<span class="comment">     * Unlock all the objects stored in the menustate structure</span></div>
<div class="line"><a name="l01827"></a><span class="lineno"> 1827</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01828"></a><span class="lineno"> 1828</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a7f41a9bbcd2f30304020b54827564df4">pMenuState</a> != NULL) {</div>
<div class="line"><a name="l01829"></a><span class="lineno"> 1829</span>&#160;        <a class="code" href="a02885.html">PMENUSTATE</a> pMenuState = pti-&gt;<a class="code" href="a02889.html#a7f41a9bbcd2f30304020b54827564df4">pMenuState</a>;</div>
<div class="line"><a name="l01830"></a><span class="lineno"> 1830</span>&#160;        <a class="code" href="a02837.html">PPOPUPMENU</a> ppopupmenuRoot = pMenuState-&gt;<a class="code" href="a02885.html#abfc93aac8825e9638c90a2fbb8bca855">pGlobalPopupMenu</a>;</div>
<div class="line"><a name="l01831"></a><span class="lineno"> 1831</span>&#160; </div>
<div class="line"><a name="l01832"></a><span class="lineno"> 1832</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01833"></a><span class="lineno"> 1833</span>&#160;<span class="comment">         * If menu mode was running on this thread</span></div>
<div class="line"><a name="l01834"></a><span class="lineno"> 1834</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01835"></a><span class="lineno"> 1835</span>&#160;        <span class="keywordflow">if</span> (pti == pMenuState-&gt;<a class="code" href="a02885.html#ac80253c995012ace1d1b53174231ca28">ptiMenuStateOwner</a>) {</div>
<div class="line"><a name="l01836"></a><span class="lineno"> 1836</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01837"></a><span class="lineno"> 1837</span>&#160;<span class="comment">             * Close this menu.</span></div>
<div class="line"><a name="l01838"></a><span class="lineno"> 1838</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01839"></a><span class="lineno"> 1839</span>&#160;            pMenuState-&gt;<a class="code" href="a02885.html#a0153e6fcd0d8052211d17aa193efeab0">fInsideMenuLoop</a> = FALSE;</div>
<div class="line"><a name="l01840"></a><span class="lineno"> 1840</span>&#160;            <a class="code" href="a03590.html#a276dfb2dab9aac12e50a66342a9e68e7">xxxMNCloseHierarchy</a>(ppopupmenuRoot, pMenuState);</div>
<div class="line"><a name="l01841"></a><span class="lineno"> 1841</span>&#160;            <a class="code" href="a00794.html#aa1a0bd0afdbee1ae21b4f429d5e1bee5">MNEndMenuState</a>(ppopupmenuRoot-&gt;<a class="code" href="a02837.html#a25e12f5244026df0821311337b73c3e9">fIsMenuBar</a> || ppopupmenuRoot-&gt;<a class="code" href="a02837.html#ae7274a49cb78fdb7c1f0665fcf883fef">fDestroyed</a>);</div>
<div class="line"><a name="l01842"></a><span class="lineno"> 1842</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l01843"></a><span class="lineno"> 1843</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l01844"></a><span class="lineno"> 1844</span>&#160;<span class="comment">             * Menu mode is running on another thread. This thread</span></div>
<div class="line"><a name="l01845"></a><span class="lineno"> 1845</span>&#160;<span class="comment">             *  must own spwndNotify which is going away soon.</span></div>
<div class="line"><a name="l01846"></a><span class="lineno"> 1846</span>&#160;<span class="comment">             * When spwndNotify is destroyed, we will clean up pMenuState</span></div>
<div class="line"><a name="l01847"></a><span class="lineno"> 1847</span>&#160;<span class="comment">             *  from this pti. So do nothing now as we&#39;ll need this</span></div>
<div class="line"><a name="l01848"></a><span class="lineno"> 1848</span>&#160;<span class="comment">             *  pMenuState at that time.</span></div>
<div class="line"><a name="l01849"></a><span class="lineno"> 1849</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l01850"></a><span class="lineno"> 1850</span>&#160;            <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>((ppopupmenuRoot-&gt;<a class="code" href="a02837.html#a472df270c88db7755093cd3ca1d1dee6">spwndNotify</a> != NULL)</div>
<div class="line"><a name="l01851"></a><span class="lineno"> 1851</span>&#160;                    &amp;&amp; (GETPTI(ppopupmenuRoot-&gt;<a class="code" href="a02837.html#a472df270c88db7755093cd3ca1d1dee6">spwndNotify</a>) == pti));</div>
<div class="line"><a name="l01852"></a><span class="lineno"> 1852</span>&#160;        }</div>
<div class="line"><a name="l01853"></a><span class="lineno"> 1853</span>&#160;    } <span class="comment">/* if (pti-&gt;pMenuState != NULL) */</span></div>
<div class="line"><a name="l01854"></a><span class="lineno"> 1854</span>&#160; </div>
<div class="line"><a name="l01855"></a><span class="lineno"> 1855</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01856"></a><span class="lineno"> 1856</span>&#160;<span class="comment">     * Unlock all the objects stored in the sbstate structure.</span></div>
<div class="line"><a name="l01857"></a><span class="lineno"> 1857</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01858"></a><span class="lineno"> 1858</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#af447983c1a621cdfd8ddac2ba3aa8819">pSBTrack</a>) {</div>
<div class="line"><a name="l01859"></a><span class="lineno"> 1859</span>&#160;        Unlock(&amp;pti-&gt;<a class="code" href="a02889.html#af447983c1a621cdfd8ddac2ba3aa8819">pSBTrack</a>-&gt;<a class="code" href="a02637.html#a502b41e3da09bf636e39a6394c466313">spwndSB</a>);</div>
<div class="line"><a name="l01860"></a><span class="lineno"> 1860</span>&#160;        Unlock(&amp;pti-&gt;<a class="code" href="a02889.html#af447983c1a621cdfd8ddac2ba3aa8819">pSBTrack</a>-&gt;<a class="code" href="a02637.html#a3f1141bdb9085129668459f2df4d9d4f">spwndSBNotify</a>);</div>
<div class="line"><a name="l01861"></a><span class="lineno"> 1861</span>&#160;        Unlock(&amp;pti-&gt;<a class="code" href="a02889.html#af447983c1a621cdfd8ddac2ba3aa8819">pSBTrack</a>-&gt;<a class="code" href="a02637.html#a3982d6da784ea13e37aa03ba23db4df3">spwndTrack</a>);</div>
<div class="line"><a name="l01862"></a><span class="lineno"> 1862</span>&#160;        UserFreePool(pti-&gt;<a class="code" href="a02889.html#af447983c1a621cdfd8ddac2ba3aa8819">pSBTrack</a>);</div>
<div class="line"><a name="l01863"></a><span class="lineno"> 1863</span>&#160;        pti-&gt;<a class="code" href="a02889.html#af447983c1a621cdfd8ddac2ba3aa8819">pSBTrack</a> = NULL;</div>
<div class="line"><a name="l01864"></a><span class="lineno"> 1864</span>&#160;    }</div>
<div class="line"><a name="l01865"></a><span class="lineno"> 1865</span>&#160; </div>
<div class="line"><a name="l01866"></a><span class="lineno"> 1866</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01867"></a><span class="lineno"> 1867</span>&#160;<span class="comment">     * If this is the main input thread of this application, zero out</span></div>
<div class="line"><a name="l01868"></a><span class="lineno"> 1868</span>&#160;<span class="comment">     * that field.</span></div>
<div class="line"><a name="l01869"></a><span class="lineno"> 1869</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01870"></a><span class="lineno"> 1870</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a> != NULL &amp;&amp; pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a78173b879891f55834e4c01a7193e359">ptiMainThread</a> == pti)</div>
<div class="line"><a name="l01871"></a><span class="lineno"> 1871</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a78173b879891f55834e4c01a7193e359">ptiMainThread</a> = NULL;</div>
<div class="line"><a name="l01872"></a><span class="lineno"> 1872</span>&#160; </div>
<div class="line"><a name="l01873"></a><span class="lineno"> 1873</span>&#160;    <span class="keywordflow">while</span> (pti-&gt;<a class="code" href="a02889.html#a285bd9fb68fc6751850f4171f6e518cd">psiiList</a> != NULL) {</div>
<div class="line"><a name="l01874"></a><span class="lineno"> 1874</span>&#160;        <a class="code" href="a00647.html#a6f12136fa17bb8e8d480fecd7431a391">xxxDestroyThreadDDEObject</a>(pti, pti-&gt;<a class="code" href="a02889.html#a285bd9fb68fc6751850f4171f6e518cd">psiiList</a>);</div>
<div class="line"><a name="l01875"></a><span class="lineno"> 1875</span>&#160;    }</div>
<div class="line"><a name="l01876"></a><span class="lineno"> 1876</span>&#160; </div>
<div class="line"><a name="l01877"></a><span class="lineno"> 1877</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01878"></a><span class="lineno"> 1878</span>&#160;<span class="comment">     * This thread might have some outstanding timers.  Destroy them</span></div>
<div class="line"><a name="l01879"></a><span class="lineno"> 1879</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01880"></a><span class="lineno"> 1880</span>&#160;    <a class="code" href="a00887.html#a2b58253786e8e91044b7d02483c17c65">DestroyThreadsTimers</a>(pti);</div>
<div class="line"><a name="l01881"></a><span class="lineno"> 1881</span>&#160; </div>
<div class="line"><a name="l01882"></a><span class="lineno"> 1882</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01883"></a><span class="lineno"> 1883</span>&#160;<span class="comment">     * Free any windows hooks this thread has created.</span></div>
<div class="line"><a name="l01884"></a><span class="lineno"> 1884</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01885"></a><span class="lineno"> 1885</span>&#160;    <a class="code" href="a00701.html#ad6d7e422abaf39b840b787b8f61dfd4e">FreeThreadsWindowHooks</a>();</div>
<div class="line"><a name="l01886"></a><span class="lineno"> 1886</span>&#160; </div>
<div class="line"><a name="l01887"></a><span class="lineno"> 1887</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01888"></a><span class="lineno"> 1888</span>&#160;<span class="comment">     * Free any hwnd lists the thread was using</span></div>
<div class="line"><a name="l01889"></a><span class="lineno"> 1889</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01890"></a><span class="lineno"> 1890</span>&#160;    <span class="keywordflow">for</span> (pbwl = <a class="code" href="a03257.html#ab5d3fc70bd0d75f9990788219356470e">pbwlList</a>; pbwl != NULL; ) {</div>
<div class="line"><a name="l01891"></a><span class="lineno"> 1891</span>&#160;        pbwlNext = pbwl-&gt;<a class="code" href="a02913.html#a3a1eb7a0fa3eacbfe24214c5b7eb8db8">pbwlNext</a>;</div>
<div class="line"><a name="l01892"></a><span class="lineno"> 1892</span>&#160;        <span class="keywordflow">if</span> (pbwl-&gt;<a class="code" href="a02913.html#a970dc45b98f6c52923abdab05a49f02a">ptiOwner</a> == pti) {</div>
<div class="line"><a name="l01893"></a><span class="lineno"> 1893</span>&#160;            <a class="code" href="a00674.html#ac42b3a26d86746846b51a69d11fc0797">FreeHwndList</a>(pbwl);</div>
<div class="line"><a name="l01894"></a><span class="lineno"> 1894</span>&#160;        }</div>
<div class="line"><a name="l01895"></a><span class="lineno"> 1895</span>&#160;        pbwl = pbwlNext;</div>
<div class="line"><a name="l01896"></a><span class="lineno"> 1896</span>&#160;    }</div>
<div class="line"><a name="l01897"></a><span class="lineno"> 1897</span>&#160; </div>
<div class="line"><a name="l01898"></a><span class="lineno"> 1898</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01899"></a><span class="lineno"> 1899</span>&#160;<span class="comment">     * Destroy all the public objects created by this thread.</span></div>
<div class="line"><a name="l01900"></a><span class="lineno"> 1900</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01901"></a><span class="lineno"> 1901</span>&#160;    <a class="code" href="a00704.html#a690606e81a12bab434ee7754ae13ea48">DestroyThreadsHotKeys</a>();</div>
<div class="line"><a name="l01902"></a><span class="lineno"> 1902</span>&#160; </div>
<div class="line"><a name="l01903"></a><span class="lineno"> 1903</span>&#160;    <a class="code" href="a00695.html#a5a81a8032897ec77f67bc27d7109b2d8">DestroyThreadsObjects</a>();</div>
<div class="line"><a name="l01904"></a><span class="lineno"> 1904</span>&#160; </div>
<div class="line"><a name="l01905"></a><span class="lineno"> 1905</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01906"></a><span class="lineno"> 1906</span>&#160;<span class="comment">     * Check if this is the last GUI thread in the process.</span></div>
<div class="line"><a name="l01907"></a><span class="lineno"> 1907</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01908"></a><span class="lineno"> 1908</span>&#160; </div>
<div class="line"><a name="l01909"></a><span class="lineno"> 1909</span>&#160;    <span class="keywordflow">if</span> ((pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>) &amp;&amp; (pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a8dec25df4d4163bb209f9f8c1bc70d45">ptiList</a> == pti) &amp;&amp; (pti-&gt;<a class="code" href="a02889.html#a318c1d57c31936937fb02314df457e08">ptiSibling</a> == NULL)) {</div>
<div class="line"><a name="l01910"></a><span class="lineno"> 1910</span>&#160;        <a class="code" href="a00824.html#ae06ed5fecef73835af8f31f5ae4d9b21">DestroyProcessesObjects</a>(pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>);</div>
<div class="line"><a name="l01911"></a><span class="lineno"> 1911</span>&#160;    }</div>
<div class="line"><a name="l01912"></a><span class="lineno"> 1912</span>&#160; </div>
<div class="line"><a name="l01913"></a><span class="lineno"> 1913</span>&#160;    Unlock(&amp;pti-&gt;<a class="code" href="a02889.html#a09237cbbe78ba3aebf853599bced5ac8">spklActive</a>);</div>
<div class="line"><a name="l01914"></a><span class="lineno"> 1914</span>&#160; </div>
<div class="line"><a name="l01915"></a><span class="lineno"> 1915</span>&#160;<span class="preprocessor">#ifdef FE_IME</span></div>
<div class="line"><a name="l01916"></a><span class="lineno"> 1916</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01917"></a><span class="lineno"> 1917</span>&#160;<span class="comment">     * Unlock default input context.</span></div>
<div class="line"><a name="l01918"></a><span class="lineno"> 1918</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01919"></a><span class="lineno"> 1919</span>&#160;    Unlock(&amp;pti-&gt;<a class="code" href="a02889.html#ace0cb78fad7ebb7cfd46f3918700cff8">spDefaultImc</a>);</div>
<div class="line"><a name="l01920"></a><span class="lineno"> 1920</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l01921"></a><span class="lineno"> 1921</span>&#160; </div>
<div class="line"><a name="l01922"></a><span class="lineno"> 1922</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a> != NULL) {</div>
<div class="line"><a name="l01923"></a><span class="lineno"> 1923</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01924"></a><span class="lineno"> 1924</span>&#160;<span class="comment">         * Remove this thread&#39;s cursor count from the queue.</span></div>
<div class="line"><a name="l01925"></a><span class="lineno"> 1925</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01926"></a><span class="lineno"> 1926</span>&#160;        pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a97845e5f321fb758821ac99bd53840de">iCursorLevel</a> -= pti-&gt;<a class="code" href="a02889.html#a97845e5f321fb758821ac99bd53840de">iCursorLevel</a>;</div>
<div class="line"><a name="l01927"></a><span class="lineno"> 1927</span>&#160; </div>
<div class="line"><a name="l01928"></a><span class="lineno"> 1928</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l01929"></a><span class="lineno"> 1929</span>&#160;<span class="comment">         * Have to recalc queue ownership after this thread</span></div>
<div class="line"><a name="l01930"></a><span class="lineno"> 1930</span>&#160;<span class="comment">         * leaves if it is a member of a shared input queue.</span></div>
<div class="line"><a name="l01931"></a><span class="lineno"> 1931</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l01932"></a><span class="lineno"> 1932</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a63df655cf92843da82e0c872b65baef1">cThreads</a> != 1) {</div>
<div class="line"><a name="l01933"></a><span class="lineno"> 1933</span>&#160;            <a class="code" href="a03257.html#abb2b4057bfd76cc925ae845dbb8c8390">gpdeskRecalcQueueAttach</a> = pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>;</div>
<div class="line"><a name="l01934"></a><span class="lineno"> 1934</span>&#160;            <a class="code" href="a03290.html#a67abc9d7678097e0d7225e4af7f7973d">SetFMouseMoved</a>();</div>
<div class="line"><a name="l01935"></a><span class="lineno"> 1935</span>&#160;        }</div>
<div class="line"><a name="l01936"></a><span class="lineno"> 1936</span>&#160;    }</div>
<div class="line"><a name="l01937"></a><span class="lineno"> 1937</span>&#160; </div>
<div class="line"><a name="l01938"></a><span class="lineno"> 1938</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01939"></a><span class="lineno"> 1939</span>&#160;<span class="comment">     * Remove from the process&#39; list, also.</span></div>
<div class="line"><a name="l01940"></a><span class="lineno"> 1940</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01941"></a><span class="lineno"> 1941</span>&#160;    ppti = &amp;PpiCurrent()-&gt;ptiList;</div>
<div class="line"><a name="l01942"></a><span class="lineno"> 1942</span>&#160;    <span class="keywordflow">if</span> (*ppti != NULL) {</div>
<div class="line"><a name="l01943"></a><span class="lineno"> 1943</span>&#160;        <span class="keywordflow">while</span> (*ppti != pti &amp;&amp; (*ppti)-&gt;<a class="code" href="a02889.html#a318c1d57c31936937fb02314df457e08">ptiSibling</a> != NULL) {</div>
<div class="line"><a name="l01944"></a><span class="lineno"> 1944</span>&#160;            ppti = &amp;((*ppti)-&gt;ptiSibling);</div>
<div class="line"><a name="l01945"></a><span class="lineno"> 1945</span>&#160;        }</div>
<div class="line"><a name="l01946"></a><span class="lineno"> 1946</span>&#160;        <span class="keywordflow">if</span> (*ppti == pti) {</div>
<div class="line"><a name="l01947"></a><span class="lineno"> 1947</span>&#160;            *ppti = pti-&gt;<a class="code" href="a02889.html#a318c1d57c31936937fb02314df457e08">ptiSibling</a>;</div>
<div class="line"><a name="l01948"></a><span class="lineno"> 1948</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a318c1d57c31936937fb02314df457e08">ptiSibling</a> = NULL;</div>
<div class="line"><a name="l01949"></a><span class="lineno"> 1949</span>&#160;        }</div>
<div class="line"><a name="l01950"></a><span class="lineno"> 1950</span>&#160;    }</div>
<div class="line"><a name="l01951"></a><span class="lineno"> 1951</span>&#160; </div>
<div class="line"><a name="l01952"></a><span class="lineno"> 1952</span>&#160; </div>
<div class="line"><a name="l01953"></a><span class="lineno"> 1953</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01954"></a><span class="lineno"> 1954</span>&#160;<span class="comment">     * Temporarily lock the desktop until the THREADINFO structure is</span></div>
<div class="line"><a name="l01955"></a><span class="lineno"> 1955</span>&#160;<span class="comment">     * freed.  Note that locking a NULL pti-&gt;rpdesk is OK.  Use a</span></div>
<div class="line"><a name="l01956"></a><span class="lineno"> 1956</span>&#160;<span class="comment">     * normal lock instead of a thread lock because the lock must</span></div>
<div class="line"><a name="l01957"></a><span class="lineno"> 1957</span>&#160;<span class="comment">     * exist past the freeing of the pti.</span></div>
<div class="line"><a name="l01958"></a><span class="lineno"> 1958</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01959"></a><span class="lineno"> 1959</span>&#160;    rpdesk = NULL;</div>
<div class="line"><a name="l01960"></a><span class="lineno"> 1960</span>&#160;    LockDesktop(&amp;rpdesk, pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>);</div>
<div class="line"><a name="l01961"></a><span class="lineno"> 1961</span>&#160; </div>
<div class="line"><a name="l01962"></a><span class="lineno"> 1962</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01963"></a><span class="lineno"> 1963</span>&#160;<span class="comment">     * Cleanup SMS structures attached to this thread.  Handles both</span></div>
<div class="line"><a name="l01964"></a><span class="lineno"> 1964</span>&#160;<span class="comment">     * pending send and receive messages. MUST make sure we do SendMsgCleanup</span></div>
<div class="line"><a name="l01965"></a><span class="lineno"> 1965</span>&#160;<span class="comment">     * AFTER window cleanup.</span></div>
<div class="line"><a name="l01966"></a><span class="lineno"> 1966</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01967"></a><span class="lineno"> 1967</span>&#160;    <a class="code" href="a00842.html#af793abfba936a5b6bdca9f922db92874">SendMsgCleanup</a>(pti);</div>
<div class="line"><a name="l01968"></a><span class="lineno"> 1968</span>&#160; </div>
<div class="line"><a name="l01969"></a><span class="lineno"> 1969</span>&#160; </div>
<div class="line"><a name="l01970"></a><span class="lineno"> 1970</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01971"></a><span class="lineno"> 1971</span>&#160;<span class="comment">     * Allow this thread to be swapped</span></div>
<div class="line"><a name="l01972"></a><span class="lineno"> 1972</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01973"></a><span class="lineno"> 1973</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#acb905cc16afd506363b5593dd0ad5dee">cEnterCount</a>) {</div>
<div class="line"><a name="l01974"></a><span class="lineno"> 1974</span>&#160;        BOOLEAN bool;</div>
<div class="line"><a name="l01975"></a><span class="lineno"> 1975</span>&#160; </div>
<div class="line"><a name="l01976"></a><span class="lineno"> 1976</span>&#160;        <a class="code" href="a00371.html#a31aafffb49dfe98bdc749c9b35c90162">RIPMSG1</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;Thread exiting with stack locked.  pti:%lX\n&quot;</span>, pti);</div>
<div class="line"><a name="l01977"></a><span class="lineno"> 1977</span>&#160;        <span class="keywordtype">bool</span> = KeSetKernelStackSwapEnable(TRUE);</div>
<div class="line"><a name="l01978"></a><span class="lineno"> 1978</span>&#160;        pti-&gt;<a class="code" href="a02889.html#acb905cc16afd506363b5593dd0ad5dee">cEnterCount</a> = 0;</div>
<div class="line"><a name="l01979"></a><span class="lineno"> 1979</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(!<span class="keywordtype">bool</span>);</div>
<div class="line"><a name="l01980"></a><span class="lineno"> 1980</span>&#160;    }</div>
<div class="line"><a name="l01981"></a><span class="lineno"> 1981</span>&#160; </div>
<div class="line"><a name="l01982"></a><span class="lineno"> 1982</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a612848a41faf6b99a0532dc84d375727">cThreads</a>--;</div>
<div class="line"><a name="l01983"></a><span class="lineno"> 1983</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a612848a41faf6b99a0532dc84d375727">cThreads</a> &gt;= 0);</div>
<div class="line"><a name="l01984"></a><span class="lineno"> 1984</span>&#160; </div>
<div class="line"><a name="l01985"></a><span class="lineno"> 1985</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l01986"></a><span class="lineno"> 1986</span>&#160;<span class="comment">     * If this thread is a win16 task, remove it from the scheduler.</span></div>
<div class="line"><a name="l01987"></a><span class="lineno"> 1987</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l01988"></a><span class="lineno"> 1988</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT) {</div>
<div class="line"><a name="l01989"></a><span class="lineno"> 1989</span>&#160;        <a class="code" href="a00881.html#ab1289f19db2055603d5d72ffb7dccc56">DestroyTask</a>(pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>, pti);</div>
<div class="line"><a name="l01990"></a><span class="lineno"> 1990</span>&#160; </div>
<div class="line"><a name="l01991"></a><span class="lineno"> 1991</span>&#160;        <span class="keywordflow">if</span> ((pti-&gt;<a class="code" href="a02889.html#af8fb3a0f2a65257b83edd457a19dca57">ptdb</a>) &amp;&amp; (pti-&gt;<a class="code" href="a02889.html#af8fb3a0f2a65257b83edd457a19dca57">ptdb</a>-&gt;<a class="code" href="a02881.html#aeabb91a1bd6171bbe97ebb98b926ec63">hTaskWow</a> != 0))</div>
<div class="line"><a name="l01992"></a><span class="lineno"> 1992</span>&#160;            <a class="code" href="a00629.html#a65cb65b2717949c25e662036c2ec1456">_WOWCleanup</a>(NULL, pti-&gt;<a class="code" href="a02889.html#af8fb3a0f2a65257b83edd457a19dca57">ptdb</a>-&gt;<a class="code" href="a02881.html#aeabb91a1bd6171bbe97ebb98b926ec63">hTaskWow</a>, NULL, 0);</div>
<div class="line"><a name="l01993"></a><span class="lineno"> 1993</span>&#160;    }</div>
<div class="line"><a name="l01994"></a><span class="lineno"> 1994</span>&#160; </div>
<div class="line"><a name="l01995"></a><span class="lineno"> 1995</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a3c194fec8e59a3c52d6c3018cff46ae9">hEventQueueClient</a> != NULL) {</div>
<div class="line"><a name="l01996"></a><span class="lineno"> 1996</span>&#160;        <a class="code" href="a00680.html#a481c734b3eea8139a042653549741891">ProtectHandle</a>(pti-&gt;<a class="code" href="a02889.html#a3c194fec8e59a3c52d6c3018cff46ae9">hEventQueueClient</a>, FALSE);</div>
<div class="line"><a name="l01997"></a><span class="lineno"> 1997</span>&#160;        ZwClose(pti-&gt;<a class="code" href="a02889.html#a3c194fec8e59a3c52d6c3018cff46ae9">hEventQueueClient</a>);</div>
<div class="line"><a name="l01998"></a><span class="lineno"> 1998</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a3c194fec8e59a3c52d6c3018cff46ae9">hEventQueueClient</a> = NULL;</div>
<div class="line"><a name="l01999"></a><span class="lineno"> 1999</span>&#160;    }</div>
<div class="line"><a name="l02000"></a><span class="lineno"> 2000</span>&#160; </div>
<div class="line"><a name="l02001"></a><span class="lineno"> 2001</span>&#160; </div>
<div class="line"><a name="l02002"></a><span class="lineno"> 2002</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a8534ae64a3a0d32b8727b62158bd1d34">gspwndInternalCapture</a> != NULL) {</div>
<div class="line"><a name="l02003"></a><span class="lineno"> 2003</span>&#160;        <span class="keywordflow">if</span> (GETPTI(<a class="code" href="a03257.html#a8534ae64a3a0d32b8727b62158bd1d34">gspwndInternalCapture</a>) == pti) {</div>
<div class="line"><a name="l02004"></a><span class="lineno"> 2004</span>&#160;            Unlock(&amp;<a class="code" href="a03257.html#a8534ae64a3a0d32b8727b62158bd1d34">gspwndInternalCapture</a>);</div>
<div class="line"><a name="l02005"></a><span class="lineno"> 2005</span>&#160;        }</div>
<div class="line"><a name="l02006"></a><span class="lineno"> 2006</span>&#160;    }</div>
<div class="line"><a name="l02007"></a><span class="lineno"> 2007</span>&#160; </div>
<div class="line"><a name="l02008"></a><span class="lineno"> 2008</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02009"></a><span class="lineno"> 2009</span>&#160;<span class="comment">     * Set gptiForeground to NULL if equal to this pti before exiting</span></div>
<div class="line"><a name="l02010"></a><span class="lineno"> 2010</span>&#160;<span class="comment">     * this routine.</span></div>
<div class="line"><a name="l02011"></a><span class="lineno"> 2011</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02012"></a><span class="lineno"> 2012</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a72d6c69b0eefb30311d982761970b971">gptiForeground</a> == pti) {</div>
<div class="line"><a name="l02013"></a><span class="lineno"> 2013</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02014"></a><span class="lineno"> 2014</span>&#160;<span class="comment">         * Call the Shell to ask it to activate its main window.</span></div>
<div class="line"><a name="l02015"></a><span class="lineno"> 2015</span>&#160;<span class="comment">         * This will be accomplished with a PostMessage() to itself,</span></div>
<div class="line"><a name="l02016"></a><span class="lineno"> 2016</span>&#160;<span class="comment">         * so the actual activation will take place later.</span></div>
<div class="line"><a name="l02017"></a><span class="lineno"> 2017</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02018"></a><span class="lineno"> 2018</span>&#160; </div>
<div class="line"><a name="l02019"></a><span class="lineno"> 2019</span>&#160;        <span class="keywordflow">if</span> (rpdesk-&gt;<a class="code" href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a009dc3c70977b9fd09afe23eb4232f76">spwndProgman</a>)</div>
<div class="line"><a name="l02020"></a><span class="lineno"> 2020</span>&#160;            <a class="code" href="a00257.html#a933a4a4818762a03428fe021dd9772a4">_PostMessage</a>(rpdesk-&gt;<a class="code" href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a009dc3c70977b9fd09afe23eb4232f76">spwndProgman</a>,<a class="code" href="a03257.html#a50563c6c979ad91669e08b094dcc0731">guiActivateShellWindow</a>, 0, 0);</div>
<div class="line"><a name="l02021"></a><span class="lineno"> 2021</span>&#160; </div>
<div class="line"><a name="l02022"></a><span class="lineno"> 2022</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02023"></a><span class="lineno"> 2023</span>&#160;<span class="comment">         * Set gptiForeground to NULL because we&#39;re destroying it.</span></div>
<div class="line"><a name="l02024"></a><span class="lineno"> 2024</span>&#160;<span class="comment">         * Since gpqForeground is derived from the foreground thread</span></div>
<div class="line"><a name="l02025"></a><span class="lineno"> 2025</span>&#160;<span class="comment">         * structure, set it to NULL as well, since there now is no</span></div>
<div class="line"><a name="l02026"></a><span class="lineno"> 2026</span>&#160;<span class="comment">         * foreground thread structure.</span></div>
<div class="line"><a name="l02027"></a><span class="lineno"> 2027</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02028"></a><span class="lineno"> 2028</span>&#160;        <a class="code" href="a03257.html#a72d6c69b0eefb30311d982761970b971">gptiForeground</a> = NULL;</div>
<div class="line"><a name="l02029"></a><span class="lineno"> 2029</span>&#160;        <a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a> = NULL;</div>
<div class="line"><a name="l02030"></a><span class="lineno"> 2030</span>&#160;    }</div>
<div class="line"><a name="l02031"></a><span class="lineno"> 2031</span>&#160; </div>
<div class="line"><a name="l02032"></a><span class="lineno"> 2032</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02033"></a><span class="lineno"> 2033</span>&#160;<span class="comment">     * Make sure none of the other global thread pointers are pointing to us.</span></div>
<div class="line"><a name="l02034"></a><span class="lineno"> 2034</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02035"></a><span class="lineno"> 2035</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a248f55ad6c91324b37c63f5f471e0f13">gptiShutdownNotify</a> == pti) {</div>
<div class="line"><a name="l02036"></a><span class="lineno"> 2036</span>&#160;        <a class="code" href="a03257.html#a248f55ad6c91324b37c63f5f471e0f13">gptiShutdownNotify</a> = NULL;</div>
<div class="line"><a name="l02037"></a><span class="lineno"> 2037</span>&#160;    }</div>
<div class="line"><a name="l02038"></a><span class="lineno"> 2038</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a698fb4f9e9622f12d1056e2fdbf47cae">gptiTasklist</a> == pti) {</div>
<div class="line"><a name="l02039"></a><span class="lineno"> 2039</span>&#160;        <a class="code" href="a03257.html#a698fb4f9e9622f12d1056e2fdbf47cae">gptiTasklist</a> = NULL;</div>
<div class="line"><a name="l02040"></a><span class="lineno"> 2040</span>&#160;    }</div>
<div class="line"><a name="l02041"></a><span class="lineno"> 2041</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a774eeae0f007ae3ea612baf38cd38936">pti</a> == pti) {</div>
<div class="line"><a name="l02042"></a><span class="lineno"> 2042</span>&#160;        <a class="code" href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a>.<a class="code" href="a02917.html#a774eeae0f007ae3ea612baf38cd38936">pti</a> = NULL;</div>
<div class="line"><a name="l02043"></a><span class="lineno"> 2043</span>&#160;    }</div>
<div class="line"><a name="l02044"></a><span class="lineno"> 2044</span>&#160; </div>
<div class="line"><a name="l02045"></a><span class="lineno"> 2045</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_PALETTEAWARE)</div>
<div class="line"><a name="l02046"></a><span class="lineno"> 2046</span>&#160;        <a class="code" href="a00815.html#ac2b66e10f5ca99676b77a368c7612687">xxxFlushPalette</a>(pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>-&gt;<a class="code" href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a68937d60a6f49b7a8431db62b38ea721">spwnd</a>);</div>
<div class="line"><a name="l02047"></a><span class="lineno"> 2047</span>&#160; </div>
<div class="line"><a name="l02048"></a><span class="lineno"> 2048</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02049"></a><span class="lineno"> 2049</span>&#160;<span class="comment">     * May be called from xxxCreateThreadInfo before the queue is created</span></div>
<div class="line"><a name="l02050"></a><span class="lineno"> 2050</span>&#160;<span class="comment">     * so check for NULL queue.</span></div>
<div class="line"><a name="l02051"></a><span class="lineno"> 2051</span>&#160;<span class="comment">     * Lock the queues since this pti might be locked. They will be unlocked</span></div>
<div class="line"><a name="l02052"></a><span class="lineno"> 2052</span>&#160;<span class="comment">     *  in DeleteThreadInfo</span></div>
<div class="line"><a name="l02053"></a><span class="lineno"> 2053</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02054"></a><span class="lineno"> 2054</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a> != NULL) {</div>
<div class="line"><a name="l02055"></a><span class="lineno"> 2055</span>&#160;        <a class="code" href="a00824.html#aed60a33fa725810e80dd0579a0cf4830">DestroyThreadsMessages</a>(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, pti);</div>
<div class="line"><a name="l02056"></a><span class="lineno"> 2056</span>&#160;        (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a>)++;</div>
<div class="line"><a name="l02057"></a><span class="lineno"> 2057</span>&#160;        <a class="code" href="a00824.html#aeafdb7a2066a7b9a1c036e2db4ca0f35">DestroyQueue</a>(pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>, pti);</div>
<div class="line"><a name="l02058"></a><span class="lineno"> 2058</span>&#160;    }</div>
<div class="line"><a name="l02059"></a><span class="lineno"> 2059</span>&#160; </div>
<div class="line"><a name="l02060"></a><span class="lineno"> 2060</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a> != NULL) {</div>
<div class="line"><a name="l02061"></a><span class="lineno"> 2061</span>&#160;        <a class="code" href="a00824.html#aed60a33fa725810e80dd0579a0cf4830">DestroyThreadsMessages</a>(pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a>, pti);</div>
<div class="line"><a name="l02062"></a><span class="lineno"> 2062</span>&#160;        (pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a>-&gt;<a class="code" href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">cLockCount</a>)++;</div>
<div class="line"><a name="l02063"></a><span class="lineno"> 2063</span>&#160;        <a class="code" href="a00824.html#aeafdb7a2066a7b9a1c036e2db4ca0f35">DestroyQueue</a>(pti-&gt;<a class="code" href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">pqAttach</a>, pti);</div>
<div class="line"><a name="l02064"></a><span class="lineno"> 2064</span>&#160;    }</div>
<div class="line"><a name="l02065"></a><span class="lineno"> 2065</span>&#160; </div>
<div class="line"><a name="l02066"></a><span class="lineno"> 2066</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02067"></a><span class="lineno"> 2067</span>&#160;<span class="comment">     * Remove the pti from its pti list and reset the pointers.</span></div>
<div class="line"><a name="l02068"></a><span class="lineno"> 2068</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02069"></a><span class="lineno"> 2069</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a> != NULL) {</div>
<div class="line"><a name="l02070"></a><span class="lineno"> 2070</span>&#160;        RemoveEntryList(&amp;pti-&gt;<a class="code" href="a02889.html#a46e17f3cb4ad052b2236c1d9987111b6">PtiLink</a>);</div>
<div class="line"><a name="l02071"></a><span class="lineno"> 2071</span>&#160;        InitializeListHead(&amp;pti-&gt;<a class="code" href="a02889.html#a46e17f3cb4ad052b2236c1d9987111b6">PtiLink</a>);</div>
<div class="line"><a name="l02072"></a><span class="lineno"> 2072</span>&#160;    }</div>
<div class="line"><a name="l02073"></a><span class="lineno"> 2073</span>&#160; </div>
<div class="line"><a name="l02074"></a><span class="lineno"> 2074</span>&#160;    <a class="code" href="a00824.html#a7a86c4e19f6b63c35d8b33b891a400c9">FreeMessageList</a>(&amp;pti-&gt;<a class="code" href="a02889.html#a64e1dadbca00e671a6b925590f57e268">mlPost</a>);</div>
<div class="line"><a name="l02075"></a><span class="lineno"> 2075</span>&#160; </div>
<div class="line"><a name="l02076"></a><span class="lineno"> 2076</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02077"></a><span class="lineno"> 2077</span>&#160;<span class="comment">     * Free any attachinfo structures pointing to this thread</span></div>
<div class="line"><a name="l02078"></a><span class="lineno"> 2078</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02079"></a><span class="lineno"> 2079</span>&#160;    ppai = &amp;<a class="code" href="a03257.html#a0358e1b51ee64a8ac724d12f71ab14a5">gpai</a>;</div>
<div class="line"><a name="l02080"></a><span class="lineno"> 2080</span>&#160;    <span class="keywordflow">while</span> ((*ppai) != NULL) {</div>
<div class="line"><a name="l02081"></a><span class="lineno"> 2081</span>&#160;        <span class="keywordflow">if</span> ((*ppai)-&gt;pti1 == pti || (*ppai)-&gt;pti2 == pti) {</div>
<div class="line"><a name="l02082"></a><span class="lineno"> 2082</span>&#160;            <a class="code" href="a02873.html">PATTACHINFO</a> paiKill = *ppai;</div>
<div class="line"><a name="l02083"></a><span class="lineno"> 2083</span>&#160;            *ppai = (*ppai)-&gt;<a class="code" href="a02873.html#a23f4b2005ab46e384ad14699e7a6eff7">paiNext</a>;</div>
<div class="line"><a name="l02084"></a><span class="lineno"> 2084</span>&#160;            UserFreePool((HLOCAL)paiKill);</div>
<div class="line"><a name="l02085"></a><span class="lineno"> 2085</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02086"></a><span class="lineno"> 2086</span>&#160;            ppai = &amp;(*ppai)-&gt;<a class="code" href="a02873.html#a23f4b2005ab46e384ad14699e7a6eff7">paiNext</a>;</div>
<div class="line"><a name="l02087"></a><span class="lineno"> 2087</span>&#160;        }</div>
<div class="line"><a name="l02088"></a><span class="lineno"> 2088</span>&#160;    }</div>
<div class="line"><a name="l02089"></a><span class="lineno"> 2089</span>&#160; </div>
<div class="line"><a name="l02090"></a><span class="lineno"> 2090</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02091"></a><span class="lineno"> 2091</span>&#160;<span class="comment">     * Change ownership of any objects that didn&#39;t get freed (because they</span></div>
<div class="line"><a name="l02092"></a><span class="lineno"> 2092</span>&#160;<span class="comment">     * are locked or we have a bug and the object didn&#39;t get destroyed).</span></div>
<div class="line"><a name="l02093"></a><span class="lineno"> 2093</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02094"></a><span class="lineno"> 2094</span>&#160;    <a class="code" href="a00695.html#accaefd632c9d99e48d39a96e9b66f2ef">MarkThreadsObjects</a>(pti);</div>
<div class="line"><a name="l02095"></a><span class="lineno"> 2095</span>&#160; </div>
<div class="line"><a name="l02096"></a><span class="lineno"> 2096</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02097"></a><span class="lineno"> 2097</span>&#160;<span class="comment">     * Free thread information visible from client</span></div>
<div class="line"><a name="l02098"></a><span class="lineno"> 2098</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02099"></a><span class="lineno"> 2099</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a> != NULL &amp;&amp; pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a> != &amp;(pti-&gt;<a class="code" href="a02889.html#a600a7e9e5efe8158b113973e9f65b6fa">cti</a>)) {</div>
<div class="line"><a name="l02100"></a><span class="lineno"> 2100</span>&#160;        DesktopFree(rpdesk-&gt;<a class="code" href="a02801.html#a7e126c1a4f38cc704dd65b5b3cfb0745">hheapDesktop</a>, pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>);</div>
<div class="line"><a name="l02101"></a><span class="lineno"> 2101</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a> = &amp;(pti-&gt;<a class="code" href="a02889.html#a600a7e9e5efe8158b113973e9f65b6fa">cti</a>);</div>
<div class="line"><a name="l02102"></a><span class="lineno"> 2102</span>&#160;    }</div>
<div class="line"><a name="l02103"></a><span class="lineno"> 2103</span>&#160; </div>
<div class="line"><a name="l02104"></a><span class="lineno"> 2104</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02105"></a><span class="lineno"> 2105</span>&#160;<span class="comment">     * Free the client info for system threads</span></div>
<div class="line"><a name="l02106"></a><span class="lineno"> 2106</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02107"></a><span class="lineno"> 2107</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SYSTEMTHREAD &amp;&amp; pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a> != NULL) {</div>
<div class="line"><a name="l02108"></a><span class="lineno"> 2108</span>&#160;        UserFreePool(pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>);</div>
<div class="line"><a name="l02109"></a><span class="lineno"> 2109</span>&#160;        pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a> = NULL;</div>
<div class="line"><a name="l02110"></a><span class="lineno"> 2110</span>&#160;    }</div>
<div class="line"><a name="l02111"></a><span class="lineno"> 2111</span>&#160; </div>
<div class="line"><a name="l02112"></a><span class="lineno"> 2112</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02113"></a><span class="lineno"> 2113</span>&#160;<span class="comment">     * Unlock the temporary desktop lock. pti-&gt;rpdesk is still locked</span></div>
<div class="line"><a name="l02114"></a><span class="lineno"> 2114</span>&#160;<span class="comment">     *  and will be unlocked in DeleteThreadInfo.</span></div>
<div class="line"><a name="l02115"></a><span class="lineno"> 2115</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02116"></a><span class="lineno"> 2116</span>&#160;    UnlockDesktop(&amp;rpdesk);</div>
<div class="line"><a name="l02117"></a><span class="lineno"> 2117</span>&#160;}</div>
<div class="line"><a name="l02118"></a><span class="lineno"> 2118</span>&#160; </div>
<div class="line"><a name="l02119"></a><span class="lineno"> 2119</span>&#160; </div>
<div class="line"><a name="l02120"></a><span class="lineno"> 2120</span>&#160; </div>
<div class="line"><a name="l02129"></a><span class="lineno"><a class="line" href="a00824.html#a41c36c29c72ea20161333931eaa8302f"> 2129</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#a41c36c29c72ea20161333931eaa8302f">CleanEventMessage</a>(</div>
<div class="line"><a name="l02130"></a><span class="lineno"> 2130</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsg)</div>
<div class="line"><a name="l02131"></a><span class="lineno"> 2131</span>&#160;{</div>
<div class="line"><a name="l02132"></a><span class="lineno"> 2132</span>&#160;    <a class="code" href="a02953.html">PASYNCSENDMSG</a> pmsg;</div>
<div class="line"><a name="l02133"></a><span class="lineno"> 2133</span>&#160;    <span class="keywordtype">void</span> <a class="code" href="a03290.html#a0dee150599c13a9794347efe8e435f6f">FreeKeyState</a>(PBYTE pKeyState);</div>
<div class="line"><a name="l02134"></a><span class="lineno"> 2134</span>&#160; </div>
<div class="line"><a name="l02135"></a><span class="lineno"> 2135</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02136"></a><span class="lineno"> 2136</span>&#160;<span class="comment">     * Certain special messages on the INPUT queue have associated</span></div>
<div class="line"><a name="l02137"></a><span class="lineno"> 2137</span>&#160;<span class="comment">     * bits of memory that need to be freed.</span></div>
<div class="line"><a name="l02138"></a><span class="lineno"> 2138</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02139"></a><span class="lineno"> 2139</span>&#160;    <span class="keywordflow">switch</span> (pqmsg-&gt;<a class="code" href="a02857.html#ac4e11a54fcd4eb693fc0c04630804f67">dwQEvent</a>) {</div>
<div class="line"><a name="l02140"></a><span class="lineno"> 2140</span>&#160;    <span class="keywordflow">case</span> QEVENT_SETWINDOWPOS:</div>
<div class="line"><a name="l02141"></a><span class="lineno"> 2141</span>&#160;        UserFreePool((<a class="code" href="a02773.html">PSMWP</a>)pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam);</div>
<div class="line"><a name="l02142"></a><span class="lineno"> 2142</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02143"></a><span class="lineno"> 2143</span>&#160; </div>
<div class="line"><a name="l02144"></a><span class="lineno"> 2144</span>&#160;    <span class="keywordflow">case</span> QEVENT_UPDATEKEYSTATE:</div>
<div class="line"><a name="l02145"></a><span class="lineno"> 2145</span>&#160;        <a class="code" href="a03290.html#a0dee150599c13a9794347efe8e435f6f">FreeKeyState</a>((PBYTE)pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam);</div>
<div class="line"><a name="l02146"></a><span class="lineno"> 2146</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02147"></a><span class="lineno"> 2147</span>&#160; </div>
<div class="line"><a name="l02148"></a><span class="lineno"> 2148</span>&#160;    <span class="keywordflow">case</span> QEVENT_ASYNCSENDMSG:</div>
<div class="line"><a name="l02149"></a><span class="lineno"> 2149</span>&#160;        pmsg = (<a class="code" href="a00899.html#a039f7fd6f36069ebd5cd93bce4e70751">PASYNCSENDMSG</a>)pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam;</div>
<div class="line"><a name="l02150"></a><span class="lineno"> 2150</span>&#160;        DeleteAtom((ATOM)pmsg-&gt;<a class="code" href="a02953.html#a5e6806726c901bac1a235d0caf8deb96">lParam</a>);</div>
<div class="line"><a name="l02151"></a><span class="lineno"> 2151</span>&#160;        UserFreePool(pmsg);</div>
<div class="line"><a name="l02152"></a><span class="lineno"> 2152</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02153"></a><span class="lineno"> 2153</span>&#160;    }</div>
<div class="line"><a name="l02154"></a><span class="lineno"> 2154</span>&#160;}</div>
<div class="line"><a name="l02155"></a><span class="lineno"> 2155</span>&#160; </div>
<div class="line"><a name="l02156"></a><span class="lineno"> 2156</span>&#160; </div>
<div class="line"><a name="l02164"></a><span class="lineno"><a class="line" href="a00899.html#a7a86c4e19f6b63c35d8b33b891a400c9"> 2164</a></span>&#160;VOID <a class="code" href="a00824.html#a7a86c4e19f6b63c35d8b33b891a400c9">FreeMessageList</a>(</div>
<div class="line"><a name="l02165"></a><span class="lineno"> 2165</span>&#160;    <a class="code" href="a02865.html">PMLIST</a> pml)</div>
<div class="line"><a name="l02166"></a><span class="lineno"> 2166</span>&#160;{</div>
<div class="line"><a name="l02167"></a><span class="lineno"> 2167</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsg;</div>
<div class="line"><a name="l02168"></a><span class="lineno"> 2168</span>&#160; </div>
<div class="line"><a name="l02169"></a><span class="lineno"> 2169</span>&#160;    <a class="code" href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">DebugValidateMLIST</a>(pml);</div>
<div class="line"><a name="l02170"></a><span class="lineno"> 2170</span>&#160; </div>
<div class="line"><a name="l02171"></a><span class="lineno"> 2171</span>&#160;    <span class="keywordflow">while</span> ((pqmsg = pml-&gt;<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>) != NULL) {</div>
<div class="line"><a name="l02172"></a><span class="lineno"> 2172</span>&#160;        <a class="code" href="a00824.html#a41c36c29c72ea20161333931eaa8302f">CleanEventMessage</a>(pqmsg);</div>
<div class="line"><a name="l02173"></a><span class="lineno"> 2173</span>&#160;        <a class="code" href="a00824.html#ae4353c386ec9e86fd65fde7125ecabb0">DelQEntry</a>(pml, pqmsg);</div>
<div class="line"><a name="l02174"></a><span class="lineno"> 2174</span>&#160;    }</div>
<div class="line"><a name="l02175"></a><span class="lineno"> 2175</span>&#160; </div>
<div class="line"><a name="l02176"></a><span class="lineno"> 2176</span>&#160;    <a class="code" href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">DebugValidateMLIST</a>(pml);</div>
<div class="line"><a name="l02177"></a><span class="lineno"> 2177</span>&#160;}</div>
<div class="line"><a name="l02178"></a><span class="lineno"> 2178</span>&#160; </div>
<div class="line"><a name="l02179"></a><span class="lineno"> 2179</span>&#160; </div>
<div class="line"><a name="l02186"></a><span class="lineno"><a class="line" href="a00824.html#aed60a33fa725810e80dd0579a0cf4830"> 2186</a></span>&#160;VOID <a class="code" href="a00824.html#aed60a33fa725810e80dd0579a0cf4830">DestroyThreadsMessages</a>(</div>
<div class="line"><a name="l02187"></a><span class="lineno"> 2187</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq,</div>
<div class="line"><a name="l02188"></a><span class="lineno"> 2188</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti)</div>
<div class="line"><a name="l02189"></a><span class="lineno"> 2189</span>&#160;{</div>
<div class="line"><a name="l02190"></a><span class="lineno"> 2190</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsg;</div>
<div class="line"><a name="l02191"></a><span class="lineno"> 2191</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsgNext;</div>
<div class="line"><a name="l02192"></a><span class="lineno"> 2192</span>&#160; </div>
<div class="line"><a name="l02193"></a><span class="lineno"> 2193</span>&#160;    <a class="code" href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">DebugValidateMLIST</a>(&amp;pq-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>);</div>
<div class="line"><a name="l02194"></a><span class="lineno"> 2194</span>&#160; </div>
<div class="line"><a name="l02195"></a><span class="lineno"> 2195</span>&#160;    pqmsg = pq-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>;</div>
<div class="line"><a name="l02196"></a><span class="lineno"> 2196</span>&#160;    <span class="keywordflow">while</span> (pqmsg != NULL) {</div>
<div class="line"><a name="l02197"></a><span class="lineno"> 2197</span>&#160;        pqmsgNext = pqmsg-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a>;</div>
<div class="line"><a name="l02198"></a><span class="lineno"> 2198</span>&#160;        <span class="keywordflow">if</span> (pqmsg-&gt;<a class="code" href="a02857.html#a774eeae0f007ae3ea612baf38cd38936">pti</a> == pti) {</div>
<div class="line"><a name="l02199"></a><span class="lineno"> 2199</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02200"></a><span class="lineno"> 2200</span>&#160;<span class="comment">             * Make sure we don&#39;t leave any bogus references to this message</span></div>
<div class="line"><a name="l02201"></a><span class="lineno"> 2201</span>&#160;<span class="comment">             * lying around.</span></div>
<div class="line"><a name="l02202"></a><span class="lineno"> 2202</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02203"></a><span class="lineno"> 2203</span>&#160;            <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> == (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)pqmsg) {</div>
<div class="line"><a name="l02204"></a><span class="lineno"> 2204</span>&#160;                <a class="code" href="a00899.html#adc99299add8f7128f863256c6901cf41">CheckPtiSysPeek</a>(8, pq, 0);</div>
<div class="line"><a name="l02205"></a><span class="lineno"> 2205</span>&#160;                pq-&gt;<a class="code" href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">idSysPeek</a> = 0;</div>
<div class="line"><a name="l02206"></a><span class="lineno"> 2206</span>&#160;            }</div>
<div class="line"><a name="l02207"></a><span class="lineno"> 2207</span>&#160;            <a class="code" href="a00824.html#a41c36c29c72ea20161333931eaa8302f">CleanEventMessage</a>(pqmsg);</div>
<div class="line"><a name="l02208"></a><span class="lineno"> 2208</span>&#160;            <a class="code" href="a00824.html#ae4353c386ec9e86fd65fde7125ecabb0">DelQEntry</a>(&amp;pq-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>, pqmsg);</div>
<div class="line"><a name="l02209"></a><span class="lineno"> 2209</span>&#160;        }</div>
<div class="line"><a name="l02210"></a><span class="lineno"> 2210</span>&#160;        pqmsg = pqmsgNext;</div>
<div class="line"><a name="l02211"></a><span class="lineno"> 2211</span>&#160;    }</div>
<div class="line"><a name="l02212"></a><span class="lineno"> 2212</span>&#160; </div>
<div class="line"><a name="l02213"></a><span class="lineno"> 2213</span>&#160;    <a class="code" href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">DebugValidateMLIST</a>(&amp;pq-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>);</div>
<div class="line"><a name="l02214"></a><span class="lineno"> 2214</span>&#160;}</div>
<div class="line"><a name="l02215"></a><span class="lineno"> 2215</span>&#160; </div>
<div class="line"><a name="l02216"></a><span class="lineno"> 2216</span>&#160; </div>
<div class="line"><a name="l02226"></a><span class="lineno"> 2226</span>&#160;NTSTATUS</div>
<div class="line"><a name="l02227"></a><span class="lineno"><a class="line" href="a00824.html#a5f74500e03b484ebab534e6cc8513b6f"> 2227</a></span>&#160;<a class="code" href="a00824.html#a5f74500e03b484ebab534e6cc8513b6f">InitQEntryLookaside</a>()</div>
<div class="line"><a name="l02228"></a><span class="lineno"> 2228</span>&#160;{</div>
<div class="line"><a name="l02229"></a><span class="lineno"> 2229</span>&#160;    ULONG BlockSize;</div>
<div class="line"><a name="l02230"></a><span class="lineno"> 2230</span>&#160;    ULONG InitialSegmentSize;</div>
<div class="line"><a name="l02231"></a><span class="lineno"> 2231</span>&#160; </div>
<div class="line"><a name="l02232"></a><span class="lineno"> 2232</span>&#160;    BlockSize = (<span class="keyword">sizeof</span>(<a class="code" href="a00899.html#a2b8978b733286dd03b48e8d53510e505">QMSG</a>) + 7) &amp; ~7;</div>
<div class="line"><a name="l02233"></a><span class="lineno"> 2233</span>&#160;    InitialSegmentSize = 16 * BlockSize + <span class="keyword">sizeof</span>(ZONE_SEGMENT_HEADER);</div>
<div class="line"><a name="l02234"></a><span class="lineno"> 2234</span>&#160; </div>
<div class="line"><a name="l02235"></a><span class="lineno"> 2235</span>&#160;    <a class="code" href="a00824.html#afb5d4ad1a9187731f8d009e2edf71ef4">QEntryLookasideBase</a> = UserAllocPool(InitialSegmentSize, TAG_LOOKASIDE);</div>
<div class="line"><a name="l02236"></a><span class="lineno"> 2236</span>&#160; </div>
<div class="line"><a name="l02237"></a><span class="lineno"> 2237</span>&#160;    <span class="keywordflow">if</span> ( !<a class="code" href="a00824.html#afb5d4ad1a9187731f8d009e2edf71ef4">QEntryLookasideBase</a> ) {</div>
<div class="line"><a name="l02238"></a><span class="lineno"> 2238</span>&#160;        <span class="keywordflow">return</span> STATUS_NO_MEMORY;</div>
<div class="line"><a name="l02239"></a><span class="lineno"> 2239</span>&#160;        }</div>
<div class="line"><a name="l02240"></a><span class="lineno"> 2240</span>&#160; </div>
<div class="line"><a name="l02241"></a><span class="lineno"> 2241</span>&#160;    <a class="code" href="a00824.html#a08b7806fdd50cc30030d391686fbce53">QEntryLookasideBounds</a> = (PVOID)((PUCHAR)<a class="code" href="a00824.html#afb5d4ad1a9187731f8d009e2edf71ef4">QEntryLookasideBase</a> + InitialSegmentSize);</div>
<div class="line"><a name="l02242"></a><span class="lineno"> 2242</span>&#160; </div>
<div class="line"><a name="l02243"></a><span class="lineno"> 2243</span>&#160;    <span class="keywordflow">return</span> ExInitializeZone(&amp;<a class="code" href="a00824.html#acca9241955afe10b5ed2fba6048ed484">QEntryLookasideZone</a>,</div>
<div class="line"><a name="l02244"></a><span class="lineno"> 2244</span>&#160;                            BlockSize,</div>
<div class="line"><a name="l02245"></a><span class="lineno"> 2245</span>&#160;                            <a class="code" href="a00824.html#afb5d4ad1a9187731f8d009e2edf71ef4">QEntryLookasideBase</a>,</div>
<div class="line"><a name="l02246"></a><span class="lineno"> 2246</span>&#160;                            InitialSegmentSize);</div>
<div class="line"><a name="l02247"></a><span class="lineno"> 2247</span>&#160;}</div>
<div class="line"><a name="l02248"></a><span class="lineno"> 2248</span>&#160; </div>
<div class="line"><a name="l02249"></a><span class="lineno"> 2249</span>&#160; </div>
<div class="line"><a name="l02258"></a><span class="lineno"><a class="line" href="a00899.html#a33338ab17ca4eb073cf36ecc1ae32435"> 2258</a></span>&#160;<a class="code" href="a02857.html">PQMSG</a> <a class="code" href="a00824.html#a33338ab17ca4eb073cf36ecc1ae32435">AllocQEntry</a>(</div>
<div class="line"><a name="l02259"></a><span class="lineno"> 2259</span>&#160;    <a class="code" href="a02865.html">PMLIST</a> pml)</div>
<div class="line"><a name="l02260"></a><span class="lineno"> 2260</span>&#160;{</div>
<div class="line"><a name="l02261"></a><span class="lineno"> 2261</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsg;</div>
<div class="line"><a name="l02262"></a><span class="lineno"> 2262</span>&#160; </div>
<div class="line"><a name="l02263"></a><span class="lineno"> 2263</span>&#160;    <a class="code" href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">DebugValidateMLIST</a>(pml);</div>
<div class="line"><a name="l02264"></a><span class="lineno"> 2264</span>&#160; </div>
<div class="line"><a name="l02265"></a><span class="lineno"> 2265</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02266"></a><span class="lineno"> 2266</span>&#160;<span class="comment">     * Attempt to get a QMSG from the zone. If this fails, then</span></div>
<div class="line"><a name="l02267"></a><span class="lineno"> 2267</span>&#160;<span class="comment">     * LocalAlloc the QMSG</span></div>
<div class="line"><a name="l02268"></a><span class="lineno"> 2268</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02269"></a><span class="lineno"> 2269</span>&#160;    pqmsg = ExAllocateFromZone(&amp;<a class="code" href="a00824.html#acca9241955afe10b5ed2fba6048ed484">QEntryLookasideZone</a>);</div>
<div class="line"><a name="l02270"></a><span class="lineno"> 2270</span>&#160; </div>
<div class="line"><a name="l02271"></a><span class="lineno"> 2271</span>&#160;    <span class="keywordflow">if</span> ( !pqmsg ) {</div>
<div class="line"><a name="l02272"></a><span class="lineno"> 2272</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02273"></a><span class="lineno"> 2273</span>&#160;<span class="comment">         * Allocate a Q message structure.</span></div>
<div class="line"><a name="l02274"></a><span class="lineno"> 2274</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02275"></a><span class="lineno"> 2275</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l02276"></a><span class="lineno"> 2276</span>&#160;        AllocQEntrySlowCalls++;</div>
<div class="line"><a name="l02277"></a><span class="lineno"> 2277</span>&#160;<span class="preprocessor">#endif // DBG</span></div>
<div class="line"><a name="l02278"></a><span class="lineno"> 2278</span>&#160;        <span class="keywordflow">if</span> ((pqmsg = (<a class="code" href="a02857.html">PQMSG</a>)UserAllocPool(<span class="keyword">sizeof</span>(<a class="code" href="a02857.html">QMSG</a>), TAG_QMSG)) == NULL)</div>
<div class="line"><a name="l02279"></a><span class="lineno"> 2279</span>&#160;            <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l02280"></a><span class="lineno"> 2280</span>&#160;        }</div>
<div class="line"><a name="l02281"></a><span class="lineno"> 2281</span>&#160;    RtlZeroMemory(pqmsg, <span class="keyword">sizeof</span>(*pqmsg));</div>
<div class="line"><a name="l02282"></a><span class="lineno"> 2282</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l02283"></a><span class="lineno"> 2283</span>&#160;    AllocQEntryCalls++;</div>
<div class="line"><a name="l02284"></a><span class="lineno"> 2284</span>&#160; </div>
<div class="line"><a name="l02285"></a><span class="lineno"> 2285</span>&#160;    <span class="keywordflow">if</span> (AllocQEntryCalls-DelQEntryCalls &gt; AllocQEntryHiWater ) {</div>
<div class="line"><a name="l02286"></a><span class="lineno"> 2286</span>&#160;        AllocQEntryHiWater = AllocQEntryCalls-DelQEntryCalls;</div>
<div class="line"><a name="l02287"></a><span class="lineno"> 2287</span>&#160;        }</div>
<div class="line"><a name="l02288"></a><span class="lineno"> 2288</span>&#160;<span class="preprocessor">#endif // DBG</span></div>
<div class="line"><a name="l02289"></a><span class="lineno"> 2289</span>&#160; </div>
<div class="line"><a name="l02290"></a><span class="lineno"> 2290</span>&#160;    <span class="keywordflow">if</span> (pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a> != NULL) {</div>
<div class="line"><a name="l02291"></a><span class="lineno"> 2291</span>&#160;        pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a>-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a> = pqmsg;</div>
<div class="line"><a name="l02292"></a><span class="lineno"> 2292</span>&#160;        pqmsg-&gt;<a class="code" href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">pqmsgPrev</a> = pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a>;</div>
<div class="line"><a name="l02293"></a><span class="lineno"> 2293</span>&#160;        pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a> = pqmsg;</div>
<div class="line"><a name="l02294"></a><span class="lineno"> 2294</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02295"></a><span class="lineno"> 2295</span>&#160;        pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a> = pml-&gt;<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a> = pqmsg;</div>
<div class="line"><a name="l02296"></a><span class="lineno"> 2296</span>&#160;    }</div>
<div class="line"><a name="l02297"></a><span class="lineno"> 2297</span>&#160; </div>
<div class="line"><a name="l02298"></a><span class="lineno"> 2298</span>&#160;    pml-&gt;<a class="code" href="a02865.html#adcf976c068271034e6e569ce3109eb07">cMsgs</a>++;</div>
<div class="line"><a name="l02299"></a><span class="lineno"> 2299</span>&#160; </div>
<div class="line"><a name="l02300"></a><span class="lineno"> 2300</span>&#160;    <a class="code" href="a00824.html#a089b1ee79d56a4319e4ec556c2d20423">DebugValidateMLISTandQMSG</a>(pml, pqmsg);</div>
<div class="line"><a name="l02301"></a><span class="lineno"> 2301</span>&#160; </div>
<div class="line"><a name="l02302"></a><span class="lineno"> 2302</span>&#160;    <span class="keywordflow">return</span> pqmsg;</div>
<div class="line"><a name="l02303"></a><span class="lineno"> 2303</span>&#160;}</div>
<div class="line"><a name="l02304"></a><span class="lineno"> 2304</span>&#160; </div>
<div class="line"><a name="l02305"></a><span class="lineno"> 2305</span>&#160; </div>
<div class="line"><a name="l02313"></a><span class="lineno"><a class="line" href="a00899.html#ae4353c386ec9e86fd65fde7125ecabb0"> 2313</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#ae4353c386ec9e86fd65fde7125ecabb0">DelQEntry</a>(</div>
<div class="line"><a name="l02314"></a><span class="lineno"> 2314</span>&#160;    <a class="code" href="a02865.html">PMLIST</a> pml,</div>
<div class="line"><a name="l02315"></a><span class="lineno"> 2315</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsg)</div>
<div class="line"><a name="l02316"></a><span class="lineno"> 2316</span>&#160;{</div>
<div class="line"><a name="l02317"></a><span class="lineno"> 2317</span>&#160;    <a class="code" href="a00824.html#a089b1ee79d56a4319e4ec556c2d20423">DebugValidateMLISTandQMSG</a>(pml, pqmsg);</div>
<div class="line"><a name="l02318"></a><span class="lineno"> 2318</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>((<span class="keywordtype">int</span>)pml-&gt;<a class="code" href="a02865.html#adcf976c068271034e6e569ce3109eb07">cMsgs</a> &gt; 0);</div>
<div class="line"><a name="l02319"></a><span class="lineno"> 2319</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pml-&gt;<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>);</div>
<div class="line"><a name="l02320"></a><span class="lineno"> 2320</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a>);</div>
<div class="line"><a name="l02321"></a><span class="lineno"> 2321</span>&#160; </div>
<div class="line"><a name="l02322"></a><span class="lineno"> 2322</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l02323"></a><span class="lineno"> 2323</span>&#160;    DelQEntryCalls++;</div>
<div class="line"><a name="l02324"></a><span class="lineno"> 2324</span>&#160;<span class="preprocessor">#endif // DBG</span></div>
<div class="line"><a name="l02325"></a><span class="lineno"> 2325</span>&#160; </div>
<div class="line"><a name="l02326"></a><span class="lineno"> 2326</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02327"></a><span class="lineno"> 2327</span>&#160;<span class="comment">     * Unlink this pqmsg from the message list.</span></div>
<div class="line"><a name="l02328"></a><span class="lineno"> 2328</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02329"></a><span class="lineno"> 2329</span>&#160;    <span class="keywordflow">if</span> (pqmsg-&gt;<a class="code" href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">pqmsgPrev</a> != NULL)</div>
<div class="line"><a name="l02330"></a><span class="lineno"> 2330</span>&#160;        pqmsg-&gt;<a class="code" href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">pqmsgPrev</a>-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a> = pqmsg-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a>;</div>
<div class="line"><a name="l02331"></a><span class="lineno"> 2331</span>&#160; </div>
<div class="line"><a name="l02332"></a><span class="lineno"> 2332</span>&#160;    <span class="keywordflow">if</span> (pqmsg-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a> != NULL)</div>
<div class="line"><a name="l02333"></a><span class="lineno"> 2333</span>&#160;        pqmsg-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a>-&gt;<a class="code" href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">pqmsgPrev</a> = pqmsg-&gt;<a class="code" href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">pqmsgPrev</a>;</div>
<div class="line"><a name="l02334"></a><span class="lineno"> 2334</span>&#160; </div>
<div class="line"><a name="l02335"></a><span class="lineno"> 2335</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02336"></a><span class="lineno"> 2336</span>&#160;<span class="comment">     * Update the read/write pointers if necessary.</span></div>
<div class="line"><a name="l02337"></a><span class="lineno"> 2337</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02338"></a><span class="lineno"> 2338</span>&#160;    <span class="keywordflow">if</span> (pml-&gt;<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a> == pqmsg)</div>
<div class="line"><a name="l02339"></a><span class="lineno"> 2339</span>&#160;        pml-&gt;<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a> = pqmsg-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a>;</div>
<div class="line"><a name="l02340"></a><span class="lineno"> 2340</span>&#160; </div>
<div class="line"><a name="l02341"></a><span class="lineno"> 2341</span>&#160;    <span class="keywordflow">if</span> (pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a> == pqmsg)</div>
<div class="line"><a name="l02342"></a><span class="lineno"> 2342</span>&#160;        pml-&gt;<a class="code" href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">pqmsgWriteLast</a> = pqmsg-&gt;<a class="code" href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">pqmsgPrev</a>;</div>
<div class="line"><a name="l02343"></a><span class="lineno"> 2343</span>&#160; </div>
<div class="line"><a name="l02344"></a><span class="lineno"> 2344</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02345"></a><span class="lineno"> 2345</span>&#160;<span class="comment">     * Adjust the message count and free the message structure.</span></div>
<div class="line"><a name="l02346"></a><span class="lineno"> 2346</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02347"></a><span class="lineno"> 2347</span>&#160;    pml-&gt;<a class="code" href="a02865.html#adcf976c068271034e6e569ce3109eb07">cMsgs</a>--;</div>
<div class="line"><a name="l02348"></a><span class="lineno"> 2348</span>&#160; </div>
<div class="line"><a name="l02349"></a><span class="lineno"> 2349</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l02350"></a><span class="lineno"> 2350</span>&#160;    <span class="comment">// If the pqmsg was from zone, then free to zone</span></div>
<div class="line"><a name="l02351"></a><span class="lineno"> 2351</span>&#160;    <span class="comment">//</span></div>
<div class="line"><a name="l02352"></a><span class="lineno"> 2352</span>&#160;    <span class="keywordflow">if</span> ( (PVOID)pqmsg &gt;= <a class="code" href="a00824.html#afb5d4ad1a9187731f8d009e2edf71ef4">QEntryLookasideBase</a> &amp;&amp; (PVOID)pqmsg &lt; <a class="code" href="a00824.html#a08b7806fdd50cc30030d391686fbce53">QEntryLookasideBounds</a> ) {</div>
<div class="line"><a name="l02353"></a><span class="lineno"> 2353</span>&#160;        ExFreeToZone(&amp;<a class="code" href="a00824.html#acca9241955afe10b5ed2fba6048ed484">QEntryLookasideZone</a>, pqmsg);</div>
<div class="line"><a name="l02354"></a><span class="lineno"> 2354</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02355"></a><span class="lineno"> 2355</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l02356"></a><span class="lineno"> 2356</span>&#160;        DelQEntrySlowCalls++;</div>
<div class="line"><a name="l02357"></a><span class="lineno"> 2357</span>&#160;<span class="preprocessor">#endif // DBG</span></div>
<div class="line"><a name="l02358"></a><span class="lineno"> 2358</span>&#160;        UserFreePool((HLOCAL)pqmsg);</div>
<div class="line"><a name="l02359"></a><span class="lineno"> 2359</span>&#160;    }</div>
<div class="line"><a name="l02360"></a><span class="lineno"> 2360</span>&#160; </div>
<div class="line"><a name="l02361"></a><span class="lineno"> 2361</span>&#160;    <a class="code" href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">DebugValidateMLIST</a>(pml);</div>
<div class="line"><a name="l02362"></a><span class="lineno"> 2362</span>&#160;}</div>
<div class="line"><a name="l02363"></a><span class="lineno"> 2363</span>&#160; </div>
<div class="line"><a name="l02364"></a><span class="lineno"> 2364</span>&#160; </div>
<div class="line"><a name="l02372"></a><span class="lineno"><a class="line" href="a00824.html#a51cfc38140186482e8362d7bf1d3aa20"> 2372</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#a51cfc38140186482e8362d7bf1d3aa20">FreeQEntry</a>(</div>
<div class="line"><a name="l02373"></a><span class="lineno"> 2373</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsg)</div>
<div class="line"><a name="l02374"></a><span class="lineno"> 2374</span>&#160;{</div>
<div class="line"><a name="l02375"></a><span class="lineno"> 2375</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l02376"></a><span class="lineno"> 2376</span>&#160;    DelQEntryCalls++;</div>
<div class="line"><a name="l02377"></a><span class="lineno"> 2377</span>&#160;<span class="preprocessor">#endif // DBG</span></div>
<div class="line"><a name="l02378"></a><span class="lineno"> 2378</span>&#160; </div>
<div class="line"><a name="l02379"></a><span class="lineno"> 2379</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02380"></a><span class="lineno"> 2380</span>&#160;<span class="comment">     * If the pqmsg was from zone, then free to zone</span></div>
<div class="line"><a name="l02381"></a><span class="lineno"> 2381</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02382"></a><span class="lineno"> 2382</span>&#160;    <span class="keywordflow">if</span> ( (PVOID)pqmsg &gt;= <a class="code" href="a00824.html#afb5d4ad1a9187731f8d009e2edf71ef4">QEntryLookasideBase</a> &amp;&amp; (PVOID)pqmsg &lt; <a class="code" href="a00824.html#a08b7806fdd50cc30030d391686fbce53">QEntryLookasideBounds</a> ) {</div>
<div class="line"><a name="l02383"></a><span class="lineno"> 2383</span>&#160;        ExFreeToZone(&amp;<a class="code" href="a00824.html#acca9241955afe10b5ed2fba6048ed484">QEntryLookasideZone</a>, pqmsg);</div>
<div class="line"><a name="l02384"></a><span class="lineno"> 2384</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02385"></a><span class="lineno"> 2385</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l02386"></a><span class="lineno"> 2386</span>&#160;        DelQEntrySlowCalls++;</div>
<div class="line"><a name="l02387"></a><span class="lineno"> 2387</span>&#160;<span class="preprocessor">#endif // DBG</span></div>
<div class="line"><a name="l02388"></a><span class="lineno"> 2388</span>&#160;        UserFreePool((HLOCAL)pqmsg);</div>
<div class="line"><a name="l02389"></a><span class="lineno"> 2389</span>&#160;    }</div>
<div class="line"><a name="l02390"></a><span class="lineno"> 2390</span>&#160;}</div>
<div class="line"><a name="l02391"></a><span class="lineno"> 2391</span>&#160; </div>
<div class="line"><a name="l02392"></a><span class="lineno"> 2392</span>&#160; </div>
<div class="line"><a name="l02403"></a><span class="lineno"><a class="line" href="a00824.html#abe5d732b18e62463d43e6a45fa2bd9b1"> 2403</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#abe5d732b18e62463d43e6a45fa2bd9b1">CheckRemoveHotkeyBit</a>(</div>
<div class="line"><a name="l02404"></a><span class="lineno"> 2404</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l02405"></a><span class="lineno"> 2405</span>&#160;    <a class="code" href="a02865.html">PMLIST</a> pml)</div>
<div class="line"><a name="l02406"></a><span class="lineno"> 2406</span>&#160;{</div>
<div class="line"><a name="l02407"></a><span class="lineno"> 2407</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsg;</div>
<div class="line"><a name="l02408"></a><span class="lineno"> 2408</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> cHotkeys;</div>
<div class="line"><a name="l02409"></a><span class="lineno"> 2409</span>&#160; </div>
<div class="line"><a name="l02410"></a><span class="lineno"> 2410</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02411"></a><span class="lineno"> 2411</span>&#160;<span class="comment">     * Remove the QS_HOTKEY bit if there is only one WM_HOTKEY message</span></div>
<div class="line"><a name="l02412"></a><span class="lineno"> 2412</span>&#160;<span class="comment">     * in this message list.</span></div>
<div class="line"><a name="l02413"></a><span class="lineno"> 2413</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02414"></a><span class="lineno"> 2414</span>&#160;    cHotkeys = 0;</div>
<div class="line"><a name="l02415"></a><span class="lineno"> 2415</span>&#160;    <span class="keywordflow">for</span> (pqmsg = pml-&gt;<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>; pqmsg != NULL; pqmsg = pqmsg-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a>) {</div>
<div class="line"><a name="l02416"></a><span class="lineno"> 2416</span>&#160;        <span class="keywordflow">if</span> (pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message == WM_HOTKEY)</div>
<div class="line"><a name="l02417"></a><span class="lineno"> 2417</span>&#160;            cHotkeys++;</div>
<div class="line"><a name="l02418"></a><span class="lineno"> 2418</span>&#160;    }</div>
<div class="line"><a name="l02419"></a><span class="lineno"> 2419</span>&#160; </div>
<div class="line"><a name="l02420"></a><span class="lineno"> 2420</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02421"></a><span class="lineno"> 2421</span>&#160;<span class="comment">     * If there is 1 or fewer hot keys, remove the hotkey bits.</span></div>
<div class="line"><a name="l02422"></a><span class="lineno"> 2422</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02423"></a><span class="lineno"> 2423</span>&#160;    <span class="keywordflow">if</span> (cHotkeys &lt;= 1) {</div>
<div class="line"><a name="l02424"></a><span class="lineno"> 2424</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp;= ~QS_HOTKEY;</div>
<div class="line"><a name="l02425"></a><span class="lineno"> 2425</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> &amp;= ~QS_HOTKEY;</div>
<div class="line"><a name="l02426"></a><span class="lineno"> 2426</span>&#160;    }</div>
<div class="line"><a name="l02427"></a><span class="lineno"> 2427</span>&#160;}</div>
<div class="line"><a name="l02428"></a><span class="lineno"> 2428</span>&#160; </div>
<div class="line"><a name="l02429"></a><span class="lineno"> 2429</span>&#160; </div>
<div class="line"><a name="l02437"></a><span class="lineno"><a class="line" href="a00899.html#a82e5cdbaec1140ea506d903c69c9db47"> 2437</a></span>&#160;<a class="code" href="a02857.html">PQMSG</a> <a class="code" href="a00824.html#ab986ea03635f8af5bed1d0a48059ad78">FindQMsg</a>(</div>
<div class="line"><a name="l02438"></a><span class="lineno"> 2438</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l02439"></a><span class="lineno"> 2439</span>&#160;    <a class="code" href="a02865.html">PMLIST</a> pml,</div>
<div class="line"><a name="l02440"></a><span class="lineno"> 2440</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwndFilter,</div>
<div class="line"><a name="l02441"></a><span class="lineno"> 2441</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> msgMin,</div>
<div class="line"><a name="l02442"></a><span class="lineno"> 2442</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> msgMax)</div>
<div class="line"><a name="l02443"></a><span class="lineno"> 2443</span>&#160;{</div>
<div class="line"><a name="l02444"></a><span class="lineno"> 2444</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd;</div>
<div class="line"><a name="l02445"></a><span class="lineno"> 2445</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsgRead;</div>
<div class="line"><a name="l02446"></a><span class="lineno"> 2446</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> message;</div>
<div class="line"><a name="l02447"></a><span class="lineno"> 2447</span>&#160; </div>
<div class="line"><a name="l02448"></a><span class="lineno"> 2448</span>&#160;    <a class="code" href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">DebugValidateMLIST</a>(pml);</div>
<div class="line"><a name="l02449"></a><span class="lineno"> 2449</span>&#160; </div>
<div class="line"><a name="l02450"></a><span class="lineno"> 2450</span>&#160;StartScan:</div>
<div class="line"><a name="l02451"></a><span class="lineno"> 2451</span>&#160;    <span class="keywordflow">for</span> (pqmsgRead = pml-&gt;<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>; pqmsgRead != NULL;</div>
<div class="line"><a name="l02452"></a><span class="lineno"> 2452</span>&#160;            pqmsgRead = pqmsgRead-&gt;<a class="code" href="a02857.html#ae10093b6e4748c1e5b22536acccde083">pqmsgNext</a>) {</div>
<div class="line"><a name="l02453"></a><span class="lineno"> 2453</span>&#160; </div>
<div class="line"><a name="l02454"></a><span class="lineno"> 2454</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02455"></a><span class="lineno"> 2455</span>&#160;<span class="comment">         * Make sure this window is valid and doesn&#39;t have the destroy</span></div>
<div class="line"><a name="l02456"></a><span class="lineno"> 2456</span>&#160;<span class="comment">         * bit set (don&#39;t want to send it to any client side window procs</span></div>
<div class="line"><a name="l02457"></a><span class="lineno"> 2457</span>&#160;<span class="comment">         * if destroy window has been called on it).</span></div>
<div class="line"><a name="l02458"></a><span class="lineno"> 2458</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02459"></a><span class="lineno"> 2459</span>&#160;        <span class="keywordflow">if</span> ((pwnd = RevalidateHwnd(pqmsgRead-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.hwnd)) != NULL) {</div>
<div class="line"><a name="l02460"></a><span class="lineno"> 2460</span>&#160;            <span class="keywordflow">if</span> (HMIsMarkDestroy(pwnd))</div>
<div class="line"><a name="l02461"></a><span class="lineno"> 2461</span>&#160;                pwnd = NULL;</div>
<div class="line"><a name="l02462"></a><span class="lineno"> 2462</span>&#160;        }</div>
<div class="line"><a name="l02463"></a><span class="lineno"> 2463</span>&#160; </div>
<div class="line"><a name="l02464"></a><span class="lineno"> 2464</span>&#160;        <span class="keywordflow">if</span> (pwnd == NULL &amp;&amp; pqmsgRead-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.hwnd != NULL) {</div>
<div class="line"><a name="l02465"></a><span class="lineno"> 2465</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02466"></a><span class="lineno"> 2466</span>&#160;<span class="comment">             * If we&#39;re removing a WM_HOTKEY message, we may need to</span></div>
<div class="line"><a name="l02467"></a><span class="lineno"> 2467</span>&#160;<span class="comment">             * clear the QS_HOTKEY bit, since we have a special bit</span></div>
<div class="line"><a name="l02468"></a><span class="lineno"> 2468</span>&#160;<span class="comment">             * for that message.</span></div>
<div class="line"><a name="l02469"></a><span class="lineno"> 2469</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02470"></a><span class="lineno"> 2470</span>&#160;            <span class="keywordflow">if</span> (pqmsgRead-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message == WM_HOTKEY) {</div>
<div class="line"><a name="l02471"></a><span class="lineno"> 2471</span>&#160;                <a class="code" href="a00824.html#abe5d732b18e62463d43e6a45fa2bd9b1">CheckRemoveHotkeyBit</a>(pti, pml);</div>
<div class="line"><a name="l02472"></a><span class="lineno"> 2472</span>&#160;            }</div>
<div class="line"><a name="l02473"></a><span class="lineno"> 2473</span>&#160; </div>
<div class="line"><a name="l02474"></a><span class="lineno"> 2474</span>&#160;            <a class="code" href="a00824.html#ae4353c386ec9e86fd65fde7125ecabb0">DelQEntry</a>(pml, pqmsgRead);</div>
<div class="line"><a name="l02475"></a><span class="lineno"> 2475</span>&#160;            <span class="keywordflow">goto</span> StartScan;</div>
<div class="line"><a name="l02476"></a><span class="lineno"> 2476</span>&#160;        }</div>
<div class="line"><a name="l02477"></a><span class="lineno"> 2477</span>&#160; </div>
<div class="line"><a name="l02478"></a><span class="lineno"> 2478</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02479"></a><span class="lineno"> 2479</span>&#160;<span class="comment">         * Make sure this message fits both window handle and message</span></div>
<div class="line"><a name="l02480"></a><span class="lineno"> 2480</span>&#160;<span class="comment">         * filters.</span></div>
<div class="line"><a name="l02481"></a><span class="lineno"> 2481</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02482"></a><span class="lineno"> 2482</span>&#160;        <span class="keywordflow">if</span> (!<a class="code" href="a03641.html#ab30158d9de22f52e0dbe98db97b94e62">CheckPwndFilter</a>(pwnd, pwndFilter))</div>
<div class="line"><a name="l02483"></a><span class="lineno"> 2483</span>&#160;            <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l02484"></a><span class="lineno"> 2484</span>&#160; </div>
<div class="line"><a name="l02485"></a><span class="lineno"> 2485</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02486"></a><span class="lineno"> 2486</span>&#160;<span class="comment">         * If this is a fixed up dde message, then turn it into a normal</span></div>
<div class="line"><a name="l02487"></a><span class="lineno"> 2487</span>&#160;<span class="comment">         * dde message for the sake of message filtering.</span></div>
<div class="line"><a name="l02488"></a><span class="lineno"> 2488</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02489"></a><span class="lineno"> 2489</span>&#160;        message = pqmsgRead-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message;</div>
<div class="line"><a name="l02490"></a><span class="lineno"> 2490</span>&#160;        <span class="keywordflow">if</span> (CheckMsgFilter(message,</div>
<div class="line"><a name="l02491"></a><span class="lineno"> 2491</span>&#160;                (WM_DDE_FIRST + 1) | MSGFLAG_DDE_MID_THUNK,</div>
<div class="line"><a name="l02492"></a><span class="lineno"> 2492</span>&#160;                WM_DDE_LAST | MSGFLAG_DDE_MID_THUNK)) {</div>
<div class="line"><a name="l02493"></a><span class="lineno"> 2493</span>&#160;            message = message &amp; ~MSGFLAG_DDE_MID_THUNK;</div>
<div class="line"><a name="l02494"></a><span class="lineno"> 2494</span>&#160;        }</div>
<div class="line"><a name="l02495"></a><span class="lineno"> 2495</span>&#160; </div>
<div class="line"><a name="l02496"></a><span class="lineno"> 2496</span>&#160;        <span class="keywordflow">if</span> (!CheckMsgFilter(message, msgMin, msgMax))</div>
<div class="line"><a name="l02497"></a><span class="lineno"> 2497</span>&#160;            <span class="keywordflow">continue</span>;</div>
<div class="line"><a name="l02498"></a><span class="lineno"> 2498</span>&#160; </div>
<div class="line"><a name="l02499"></a><span class="lineno"> 2499</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02500"></a><span class="lineno"> 2500</span>&#160;<span class="comment">         * Found it.</span></div>
<div class="line"><a name="l02501"></a><span class="lineno"> 2501</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02502"></a><span class="lineno"> 2502</span>&#160;        <a class="code" href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">DebugValidateMLIST</a>(pml);</div>
<div class="line"><a name="l02503"></a><span class="lineno"> 2503</span>&#160;        <span class="keywordflow">return</span> pqmsgRead;</div>
<div class="line"><a name="l02504"></a><span class="lineno"> 2504</span>&#160;    }</div>
<div class="line"><a name="l02505"></a><span class="lineno"> 2505</span>&#160; </div>
<div class="line"><a name="l02506"></a><span class="lineno"> 2506</span>&#160;    <a class="code" href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">DebugValidateMLIST</a>(pml);</div>
<div class="line"><a name="l02507"></a><span class="lineno"> 2507</span>&#160;    <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l02508"></a><span class="lineno"> 2508</span>&#160;}</div>
<div class="line"><a name="l02509"></a><span class="lineno"> 2509</span>&#160; </div>
<div class="line"><a name="l02510"></a><span class="lineno"> 2510</span>&#160; </div>
<div class="line"><a name="l02518"></a><span class="lineno"><a class="line" href="a00824.html#a47a035d82bebe9c286c31ee6f165d89c"> 2518</a></span>&#160;BOOL <a class="code" href="a00824.html#a47a035d82bebe9c286c31ee6f165d89c">CheckQuitMessage</a>(</div>
<div class="line"><a name="l02519"></a><span class="lineno"> 2519</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l02520"></a><span class="lineno"> 2520</span>&#160;    LPMSG lpMsg,</div>
<div class="line"><a name="l02521"></a><span class="lineno"> 2521</span>&#160;    BOOL fRemoveMsg)</div>
<div class="line"><a name="l02522"></a><span class="lineno"> 2522</span>&#160;{</div>
<div class="line"><a name="l02523"></a><span class="lineno"> 2523</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02524"></a><span class="lineno"> 2524</span>&#160;<span class="comment">     * If there are no more posted messages in the queue and cQuit is !=</span></div>
<div class="line"><a name="l02525"></a><span class="lineno"> 2525</span>&#160;<span class="comment">     * 0, then generate a quit!</span></div>
<div class="line"><a name="l02526"></a><span class="lineno"> 2526</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02527"></a><span class="lineno"> 2527</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a09679d30cfd8c200ad9b8352eb155126">cQuit</a> != 0 &amp;&amp; pti-&gt;<a class="code" href="a02889.html#a64e1dadbca00e671a6b925590f57e268">mlPost</a>.<a class="code" href="a02865.html#adcf976c068271034e6e569ce3109eb07">cMsgs</a> == 0) {</div>
<div class="line"><a name="l02528"></a><span class="lineno"> 2528</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02529"></a><span class="lineno"> 2529</span>&#160;<span class="comment">         * If we&#39;re &quot;removing&quot; the quit, set cQuit to 0 so another one isn&#39;t</span></div>
<div class="line"><a name="l02530"></a><span class="lineno"> 2530</span>&#160;<span class="comment">         * generated.</span></div>
<div class="line"><a name="l02531"></a><span class="lineno"> 2531</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02532"></a><span class="lineno"> 2532</span>&#160;        <span class="keywordflow">if</span> (fRemoveMsg)</div>
<div class="line"><a name="l02533"></a><span class="lineno"> 2533</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a09679d30cfd8c200ad9b8352eb155126">cQuit</a> = 0;</div>
<div class="line"><a name="l02534"></a><span class="lineno"> 2534</span>&#160;        <a class="code" href="a00824.html#af9d1b276723341720a345902e1f14645">StoreMessage</a>(lpMsg, NULL, WM_QUIT, (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)pti-&gt;<a class="code" href="a02889.html#ad2b39e24db61b348a98aee43f81aac9c">exitCode</a>, 0, 0);</div>
<div class="line"><a name="l02535"></a><span class="lineno"> 2535</span>&#160;        <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l02536"></a><span class="lineno"> 2536</span>&#160;    }</div>
<div class="line"><a name="l02537"></a><span class="lineno"> 2537</span>&#160; </div>
<div class="line"><a name="l02538"></a><span class="lineno"> 2538</span>&#160;    <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l02539"></a><span class="lineno"> 2539</span>&#160;}</div>
<div class="line"><a name="l02540"></a><span class="lineno"> 2540</span>&#160; </div>
<div class="line"><a name="l02541"></a><span class="lineno"> 2541</span>&#160; </div>
<div class="line"><a name="l02542"></a><span class="lineno"> 2542</span>&#160; </div>
<div class="line"><a name="l02551"></a><span class="lineno"><a class="line" href="a00824.html#a41bf5ee671d1979f26435f9c5e6eb7c3"> 2551</a></span>&#160;BOOL <a class="code" href="a00824.html#a41bf5ee671d1979f26435f9c5e6eb7c3">xxxReadPostMessage</a>(</div>
<div class="line"><a name="l02552"></a><span class="lineno"> 2552</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l02553"></a><span class="lineno"> 2553</span>&#160;    LPMSG lpMsg,</div>
<div class="line"><a name="l02554"></a><span class="lineno"> 2554</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwndFilter,</div>
<div class="line"><a name="l02555"></a><span class="lineno"> 2555</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> msgMin,</div>
<div class="line"><a name="l02556"></a><span class="lineno"> 2556</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> msgMax,</div>
<div class="line"><a name="l02557"></a><span class="lineno"> 2557</span>&#160;    BOOL fRemoveMsg)</div>
<div class="line"><a name="l02558"></a><span class="lineno"> 2558</span>&#160;{</div>
<div class="line"><a name="l02559"></a><span class="lineno"> 2559</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsg;</div>
<div class="line"><a name="l02560"></a><span class="lineno"> 2560</span>&#160;    <a class="code" href="a02865.html">PMLIST</a> pmlPost;</div>
<div class="line"><a name="l02561"></a><span class="lineno"> 2561</span>&#160; </div>
<div class="line"><a name="l02562"></a><span class="lineno"> 2562</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02563"></a><span class="lineno"> 2563</span>&#160;<span class="comment">     * Check to see if it is time to generate a quit message.</span></div>
<div class="line"><a name="l02564"></a><span class="lineno"> 2564</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02565"></a><span class="lineno"> 2565</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a00824.html#a47a035d82bebe9c286c31ee6f165d89c">CheckQuitMessage</a>(pti, lpMsg, fRemoveMsg))</div>
<div class="line"><a name="l02566"></a><span class="lineno"> 2566</span>&#160;        <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l02567"></a><span class="lineno"> 2567</span>&#160; </div>
<div class="line"><a name="l02568"></a><span class="lineno"> 2568</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02569"></a><span class="lineno"> 2569</span>&#160;<span class="comment">     * Loop through the messages in this list looking for the one that</span></div>
<div class="line"><a name="l02570"></a><span class="lineno"> 2570</span>&#160;<span class="comment">     * fits the passed in filters.</span></div>
<div class="line"><a name="l02571"></a><span class="lineno"> 2571</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02572"></a><span class="lineno"> 2572</span>&#160;    pmlPost = &amp;pti-&gt;<a class="code" href="a02889.html#a64e1dadbca00e671a6b925590f57e268">mlPost</a>;</div>
<div class="line"><a name="l02573"></a><span class="lineno"> 2573</span>&#160;    pqmsg = <a class="code" href="a00824.html#ab986ea03635f8af5bed1d0a48059ad78">FindQMsg</a>(pti, pmlPost, pwndFilter, msgMin, msgMax);</div>
<div class="line"><a name="l02574"></a><span class="lineno"> 2574</span>&#160;    <span class="keywordflow">if</span> (pqmsg == NULL) {</div>
<div class="line"><a name="l02575"></a><span class="lineno"> 2575</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02576"></a><span class="lineno"> 2576</span>&#160;<span class="comment">         * Check again for quit... FindQMsg deletes some messages</span></div>
<div class="line"><a name="l02577"></a><span class="lineno"> 2577</span>&#160;<span class="comment">         * in some instances, so we may match the conditions</span></div>
<div class="line"><a name="l02578"></a><span class="lineno"> 2578</span>&#160;<span class="comment">         * for quit generation here.</span></div>
<div class="line"><a name="l02579"></a><span class="lineno"> 2579</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02580"></a><span class="lineno"> 2580</span>&#160;        <span class="keywordflow">if</span> (<a class="code" href="a00824.html#a47a035d82bebe9c286c31ee6f165d89c">CheckQuitMessage</a>(pti, lpMsg, fRemoveMsg))</div>
<div class="line"><a name="l02581"></a><span class="lineno"> 2581</span>&#160;            <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l02582"></a><span class="lineno"> 2582</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02583"></a><span class="lineno"> 2583</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02584"></a><span class="lineno"> 2584</span>&#160;<span class="comment">         * Update the thread info fields with the info from this qmsg.</span></div>
<div class="line"><a name="l02585"></a><span class="lineno"> 2585</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02586"></a><span class="lineno"> 2586</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a63f9a7301bdb8da51c5180336650f449">timeLast</a> = pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.time;</div>
<div class="line"><a name="l02587"></a><span class="lineno"> 2587</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a82665c77f0395ea674ade3c7a96bd9d1">ptLast</a> = pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.pt;</div>
<div class="line"><a name="l02588"></a><span class="lineno"> 2588</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a908f89e143de49ad52495f21d8231d8a">idLast</a> = (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)pqmsg;</div>
<div class="line"><a name="l02589"></a><span class="lineno"> 2589</span>&#160;        pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#acaac4c4abe64b478521a44ad7f1d692b">ExtraInfo</a> = pqmsg-&gt;<a class="code" href="a02857.html#acaac4c4abe64b478521a44ad7f1d692b">ExtraInfo</a>;</div>
<div class="line"><a name="l02590"></a><span class="lineno"> 2590</span>&#160; </div>
<div class="line"><a name="l02591"></a><span class="lineno"> 2591</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02592"></a><span class="lineno"> 2592</span>&#160;<span class="comment">         * Are we supposed to yank out the message? If not, stick some</span></div>
<div class="line"><a name="l02593"></a><span class="lineno"> 2593</span>&#160;<span class="comment">         * random id into idLast so we don&#39;t unlock the input queue until we</span></div>
<div class="line"><a name="l02594"></a><span class="lineno"> 2594</span>&#160;<span class="comment">         * pull this message from the queue.</span></div>
<div class="line"><a name="l02595"></a><span class="lineno"> 2595</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02596"></a><span class="lineno"> 2596</span>&#160;        *lpMsg = pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>;</div>
<div class="line"><a name="l02597"></a><span class="lineno"> 2597</span>&#160;        <span class="keywordflow">if</span> (!fRemoveMsg) {</div>
<div class="line"><a name="l02598"></a><span class="lineno"> 2598</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a908f89e143de49ad52495f21d8231d8a">idLast</a> = 1;</div>
<div class="line"><a name="l02599"></a><span class="lineno"> 2599</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02600"></a><span class="lineno"> 2600</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02601"></a><span class="lineno"> 2601</span>&#160;<span class="comment">             * If we&#39;re removing a WM_HOTKEY message, we may need to</span></div>
<div class="line"><a name="l02602"></a><span class="lineno"> 2602</span>&#160;<span class="comment">             * clear the QS_HOTKEY bit, since we have a special bit</span></div>
<div class="line"><a name="l02603"></a><span class="lineno"> 2603</span>&#160;<span class="comment">             * for that message.</span></div>
<div class="line"><a name="l02604"></a><span class="lineno"> 2604</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02605"></a><span class="lineno"> 2605</span>&#160;            <span class="keywordflow">if</span> (pmlPost-&gt;<a class="code" href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">pqmsgRead</a>-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message == WM_HOTKEY) {</div>
<div class="line"><a name="l02606"></a><span class="lineno"> 2606</span>&#160;                <a class="code" href="a00824.html#abe5d732b18e62463d43e6a45fa2bd9b1">CheckRemoveHotkeyBit</a>(pti, pmlPost);</div>
<div class="line"><a name="l02607"></a><span class="lineno"> 2607</span>&#160;            }</div>
<div class="line"><a name="l02608"></a><span class="lineno"> 2608</span>&#160; </div>
<div class="line"><a name="l02609"></a><span class="lineno"> 2609</span>&#160; </div>
<div class="line"><a name="l02610"></a><span class="lineno"> 2610</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02611"></a><span class="lineno"> 2611</span>&#160;<span class="comment">             * Since we&#39;re removing an event from the queue, we</span></div>
<div class="line"><a name="l02612"></a><span class="lineno"> 2612</span>&#160;<span class="comment">             * need to check priority.  This resets the TIF_SPINNING</span></div>
<div class="line"><a name="l02613"></a><span class="lineno"> 2613</span>&#160;<span class="comment">             * since we&#39;re no longer spinning.</span></div>
<div class="line"><a name="l02614"></a><span class="lineno"> 2614</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02615"></a><span class="lineno"> 2615</span>&#160;            <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SPINNING)</div>
<div class="line"><a name="l02616"></a><span class="lineno"> 2616</span>&#160;                <a class="code" href="a00824.html#acbf7182e6530b750eed27ef83e03c85f">CheckProcessForeground</a>(pti);</div>
<div class="line"><a name="l02617"></a><span class="lineno"> 2617</span>&#160; </div>
<div class="line"><a name="l02618"></a><span class="lineno"> 2618</span>&#160;            <a class="code" href="a00824.html#ae4353c386ec9e86fd65fde7125ecabb0">DelQEntry</a>(pmlPost, pqmsg);</div>
<div class="line"><a name="l02619"></a><span class="lineno"> 2619</span>&#160;        }</div>
<div class="line"><a name="l02620"></a><span class="lineno"> 2620</span>&#160; </div>
<div class="line"><a name="l02621"></a><span class="lineno"> 2621</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02622"></a><span class="lineno"> 2622</span>&#160;<span class="comment">         * See if this is a dde message that needs to be fixed up.</span></div>
<div class="line"><a name="l02623"></a><span class="lineno"> 2623</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02624"></a><span class="lineno"> 2624</span>&#160;        <span class="keywordflow">if</span> (CheckMsgFilter(lpMsg-&gt;message,</div>
<div class="line"><a name="l02625"></a><span class="lineno"> 2625</span>&#160;                (WM_DDE_FIRST + 1) | MSGFLAG_DDE_MID_THUNK,</div>
<div class="line"><a name="l02626"></a><span class="lineno"> 2626</span>&#160;                WM_DDE_LAST | MSGFLAG_DDE_MID_THUNK)) {</div>
<div class="line"><a name="l02627"></a><span class="lineno"> 2627</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02628"></a><span class="lineno"> 2628</span>&#160;<span class="comment">             * Fixup the message value.</span></div>
<div class="line"><a name="l02629"></a><span class="lineno"> 2629</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02630"></a><span class="lineno"> 2630</span>&#160;            lpMsg-&gt;message &amp;= (<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>)~MSGFLAG_DDE_MID_THUNK;</div>
<div class="line"><a name="l02631"></a><span class="lineno"> 2631</span>&#160; </div>
<div class="line"><a name="l02632"></a><span class="lineno"> 2632</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02633"></a><span class="lineno"> 2633</span>&#160;<span class="comment">             * Call back the client to allocate the dde data for this message.</span></div>
<div class="line"><a name="l02634"></a><span class="lineno"> 2634</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02635"></a><span class="lineno"> 2635</span>&#160;            <a class="code" href="a03188.html#af647df0fd7600605c1c70baf5ad7540a">xxxDDETrackGetMessageHook</a>(lpMsg);</div>
<div class="line"><a name="l02636"></a><span class="lineno"> 2636</span>&#160; </div>
<div class="line"><a name="l02637"></a><span class="lineno"> 2637</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02638"></a><span class="lineno"> 2638</span>&#160;<span class="comment">             * Copy these values back into the queue if this message hasn&#39;t</span></div>
<div class="line"><a name="l02639"></a><span class="lineno"> 2639</span>&#160;<span class="comment">             * been removed from the queue. Need to search through the</span></div>
<div class="line"><a name="l02640"></a><span class="lineno"> 2640</span>&#160;<span class="comment">             * queue again because the pqmsg may have been removed when</span></div>
<div class="line"><a name="l02641"></a><span class="lineno"> 2641</span>&#160;<span class="comment">             * we left the critical section above.</span></div>
<div class="line"><a name="l02642"></a><span class="lineno"> 2642</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02643"></a><span class="lineno"> 2643</span>&#160;            <span class="keywordflow">if</span> (!fRemoveMsg) {</div>
<div class="line"><a name="l02644"></a><span class="lineno"> 2644</span>&#160;                <span class="keywordflow">if</span> (pqmsg == <a class="code" href="a00824.html#ab986ea03635f8af5bed1d0a48059ad78">FindQMsg</a>(pti, pmlPost, pwndFilter, msgMin, msgMax)) {</div>
<div class="line"><a name="l02645"></a><span class="lineno"> 2645</span>&#160;                    pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a> = *lpMsg;</div>
<div class="line"><a name="l02646"></a><span class="lineno"> 2646</span>&#160;                }</div>
<div class="line"><a name="l02647"></a><span class="lineno"> 2647</span>&#160;            }</div>
<div class="line"><a name="l02648"></a><span class="lineno"> 2648</span>&#160;        }</div>
<div class="line"><a name="l02649"></a><span class="lineno"> 2649</span>&#160;<span class="preprocessor">#ifdef DEBUG</span></div>
<div class="line"><a name="l02650"></a><span class="lineno"> 2650</span>&#160;        <span class="keywordflow">else</span> <span class="keywordflow">if</span> (CheckMsgFilter(lpMsg-&gt;message, WM_DDE_FIRST, WM_DDE_LAST)) {</div>
<div class="line"><a name="l02651"></a><span class="lineno"> 2651</span>&#160;            <span class="keywordflow">if</span> (fRemoveMsg) {</div>
<div class="line"><a name="l02652"></a><span class="lineno"> 2652</span>&#160;                <a class="code" href="a00824.html#aa8ea52319ca33f5f02b7813e98b5dc40">TraceDdeMsg</a>(lpMsg-&gt;message, (HWND)lpMsg-&gt;wParam, lpMsg-&gt;hwnd, MSG_RECV);</div>
<div class="line"><a name="l02653"></a><span class="lineno"> 2653</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02654"></a><span class="lineno"> 2654</span>&#160;                <a class="code" href="a00824.html#aa8ea52319ca33f5f02b7813e98b5dc40">TraceDdeMsg</a>(lpMsg-&gt;message, (HWND)lpMsg-&gt;wParam, lpMsg-&gt;hwnd, MSG_PEEK);</div>
<div class="line"><a name="l02655"></a><span class="lineno"> 2655</span>&#160;            }</div>
<div class="line"><a name="l02656"></a><span class="lineno"> 2656</span>&#160;        }</div>
<div class="line"><a name="l02657"></a><span class="lineno"> 2657</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l02658"></a><span class="lineno"> 2658</span>&#160;    }</div>
<div class="line"><a name="l02659"></a><span class="lineno"> 2659</span>&#160; </div>
<div class="line"><a name="l02660"></a><span class="lineno"> 2660</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02661"></a><span class="lineno"> 2661</span>&#160;<span class="comment">     * If there are no posted messages available, clear the post message</span></div>
<div class="line"><a name="l02662"></a><span class="lineno"> 2662</span>&#160;<span class="comment">     * bit so we don&#39;t go looking for them again.</span></div>
<div class="line"><a name="l02663"></a><span class="lineno"> 2663</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02664"></a><span class="lineno"> 2664</span>&#160;    <span class="keywordflow">if</span> (pmlPost-&gt;<a class="code" href="a02865.html#adcf976c068271034e6e569ce3109eb07">cMsgs</a> == 0 &amp;&amp; pti-&gt;<a class="code" href="a02889.html#a09679d30cfd8c200ad9b8352eb155126">cQuit</a> == 0) {</div>
<div class="line"><a name="l02665"></a><span class="lineno"> 2665</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp;= ~(QS_POSTMESSAGE | QS_ALLPOSTMESSAGE);</div>
<div class="line"><a name="l02666"></a><span class="lineno"> 2666</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> &amp;= ~QS_ALLPOSTMESSAGE;</div>
<div class="line"><a name="l02667"></a><span class="lineno"> 2667</span>&#160;    }</div>
<div class="line"><a name="l02668"></a><span class="lineno"> 2668</span>&#160; </div>
<div class="line"><a name="l02669"></a><span class="lineno"> 2669</span>&#160;    <span class="keywordflow">return</span> pqmsg != NULL;</div>
<div class="line"><a name="l02670"></a><span class="lineno"> 2670</span>&#160;}</div>
<div class="line"><a name="l02671"></a><span class="lineno"> 2671</span>&#160; </div>
<div class="line"><a name="l02672"></a><span class="lineno"> 2672</span>&#160; </div>
<div class="line"><a name="l02682"></a><span class="lineno"><a class="line" href="a00899.html#ae98d2a9cd72776c2a573809d347a8366"> 2682</a></span>&#160;VOID <a class="code" href="a00824.html#ae98d2a9cd72776c2a573809d347a8366">xxxProcessEventMessage</a>(</div>
<div class="line"><a name="l02683"></a><span class="lineno"> 2683</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l02684"></a><span class="lineno"> 2684</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsg)</div>
<div class="line"><a name="l02685"></a><span class="lineno"> 2685</span>&#160;{</div>
<div class="line"><a name="l02686"></a><span class="lineno"> 2686</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd;</div>
<div class="line"><a name="l02687"></a><span class="lineno"> 2687</span>&#160;    <a class="code" href="a01881.html">TL</a> tlpwndT;</div>
<div class="line"><a name="l02688"></a><span class="lineno"> 2688</span>&#160;    <a class="code" href="a02869.html">PQ</a> pq;</div>
<div class="line"><a name="l02689"></a><span class="lineno"> 2689</span>&#160; </div>
<div class="line"><a name="l02690"></a><span class="lineno"> 2690</span>&#160;    pq = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>;</div>
<div class="line"><a name="l02691"></a><span class="lineno"> 2691</span>&#160;    <span class="keywordflow">switch</span> (pqmsg-&gt;<a class="code" href="a02857.html#ac4e11a54fcd4eb693fc0c04630804f67">dwQEvent</a>) {</div>
<div class="line"><a name="l02692"></a><span class="lineno"> 2692</span>&#160;    <span class="keywordflow">case</span> QEVENT_DESTROYWINDOW:</div>
<div class="line"><a name="l02693"></a><span class="lineno"> 2693</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02694"></a><span class="lineno"> 2694</span>&#160;<span class="comment">         * These events are posted from xxxDW_DestroyOwnedWindows</span></div>
<div class="line"><a name="l02695"></a><span class="lineno"> 2695</span>&#160;<span class="comment">         * for owned windows that are not owned by the owner</span></div>
<div class="line"><a name="l02696"></a><span class="lineno"> 2696</span>&#160;<span class="comment">         * window thread.</span></div>
<div class="line"><a name="l02697"></a><span class="lineno"> 2697</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02698"></a><span class="lineno"> 2698</span>&#160;        pwnd = RevalidateHwnd((HWND)pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam);</div>
<div class="line"><a name="l02699"></a><span class="lineno"> 2699</span>&#160;        <span class="keywordflow">if</span> (pwnd != NULL) {</div>
<div class="line"><a name="l02700"></a><span class="lineno"> 2700</span>&#160;            <span class="keywordflow">if</span> (!TestWF(pwnd, WFCHILD))</div>
<div class="line"><a name="l02701"></a><span class="lineno"> 2701</span>&#160;                <a class="code" href="a00635.html#a5a00338a3147879f7fa0ecb4a938cd8c">xxxDestroyWindow</a>(pwnd);</div>
<div class="line"><a name="l02702"></a><span class="lineno"> 2702</span>&#160;            <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02703"></a><span class="lineno"> 2703</span>&#160;                ThreadLockAlwaysWithPti(pti, pwnd, &amp;tlpwndT);</div>
<div class="line"><a name="l02704"></a><span class="lineno"> 2704</span>&#160;                <a class="code" href="a00635.html#af7f3962b7f9ad0874ead591af800fb79">xxxFreeWindow</a>(pwnd, &amp;tlpwndT);</div>
<div class="line"><a name="l02705"></a><span class="lineno"> 2705</span>&#160;            }</div>
<div class="line"><a name="l02706"></a><span class="lineno"> 2706</span>&#160;        }</div>
<div class="line"><a name="l02707"></a><span class="lineno"> 2707</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02708"></a><span class="lineno"> 2708</span>&#160; </div>
<div class="line"><a name="l02709"></a><span class="lineno"> 2709</span>&#160;    <span class="keywordflow">case</span> QEVENT_SHOWWINDOW:</div>
<div class="line"><a name="l02710"></a><span class="lineno"> 2710</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02711"></a><span class="lineno"> 2711</span>&#160;<span class="comment">         * These events are mainly used from within CascadeChildWindows()</span></div>
<div class="line"><a name="l02712"></a><span class="lineno"> 2712</span>&#160;<span class="comment">         * and TileChildWindows() so that taskmgr doesn&#39;t hang while calling</span></div>
<div class="line"><a name="l02713"></a><span class="lineno"> 2713</span>&#160;<span class="comment">         * these apis if it is trying to tile or cascade a hung application.</span></div>
<div class="line"><a name="l02714"></a><span class="lineno"> 2714</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02715"></a><span class="lineno"> 2715</span>&#160;        <span class="comment">/* The HIWORD of lParam now has the preserved state of gfAnimate at the</span></div>
<div class="line"><a name="l02716"></a><span class="lineno"> 2716</span>&#160;<span class="comment">         * time of the call.</span></div>
<div class="line"><a name="l02717"></a><span class="lineno"> 2717</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02718"></a><span class="lineno"> 2718</span>&#160;        pwnd = RevalidateHwnd((HWND)pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam);</div>
<div class="line"><a name="l02719"></a><span class="lineno"> 2719</span>&#160;        <span class="keywordflow">if</span> (pwnd != NULL) {</div>
<div class="line"><a name="l02720"></a><span class="lineno"> 2720</span>&#160;            ThreadLockAlwaysWithPti(pti, pwnd, &amp;tlpwndT);</div>
<div class="line"><a name="l02721"></a><span class="lineno"> 2721</span>&#160;            <a class="code" href="a00851.html#ae82e6ab5253cf5a51f5e270f6b83ccb7">xxxShowWindow</a>(pwnd, pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam);</div>
<div class="line"><a name="l02722"></a><span class="lineno"> 2722</span>&#160;            ThreadUnlock(&amp;tlpwndT);</div>
<div class="line"><a name="l02723"></a><span class="lineno"> 2723</span>&#160;        }</div>
<div class="line"><a name="l02724"></a><span class="lineno"> 2724</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02725"></a><span class="lineno"> 2725</span>&#160; </div>
<div class="line"><a name="l02726"></a><span class="lineno"> 2726</span>&#160;    <span class="keywordflow">case</span> QEVENT_SETWINDOWPOS:</div>
<div class="line"><a name="l02727"></a><span class="lineno"> 2727</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02728"></a><span class="lineno"> 2728</span>&#160;<span class="comment">         * QEVENT_SETWINDOWPOS events are generated when a thread calls</span></div>
<div class="line"><a name="l02729"></a><span class="lineno"> 2729</span>&#160;<span class="comment">         * SetWindowPos with a list of windows owned by threads other than</span></div>
<div class="line"><a name="l02730"></a><span class="lineno"> 2730</span>&#160;<span class="comment">         * itself.  This way all WINDOWPOSing on a window is done the thread</span></div>
<div class="line"><a name="l02731"></a><span class="lineno"> 2731</span>&#160;<span class="comment">         * that owns (created) the window and we don&#39;t have any of those</span></div>
<div class="line"><a name="l02732"></a><span class="lineno"> 2732</span>&#160;<span class="comment">         * nasty inter-thread synchronization problems.</span></div>
<div class="line"><a name="l02733"></a><span class="lineno"> 2733</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02734"></a><span class="lineno"> 2734</span>&#160;        <a class="code" href="a00872.html#ac7afeeae4842cb12f6533b053ce72210">xxxProcessSetWindowPosEvent</a>((<a class="code" href="a02773.html">PSMWP</a>)pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam);</div>
<div class="line"><a name="l02735"></a><span class="lineno"> 2735</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02736"></a><span class="lineno"> 2736</span>&#160; </div>
<div class="line"><a name="l02737"></a><span class="lineno"> 2737</span>&#160;    <span class="keywordflow">case</span> QEVENT_UPDATEKEYSTATE:</div>
<div class="line"><a name="l02738"></a><span class="lineno"> 2738</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02739"></a><span class="lineno"> 2739</span>&#160;<span class="comment">         * Update the local key state with the state from those</span></div>
<div class="line"><a name="l02740"></a><span class="lineno"> 2740</span>&#160;<span class="comment">         * keys that have changed since the last time key state</span></div>
<div class="line"><a name="l02741"></a><span class="lineno"> 2741</span>&#160;<span class="comment">         * was synchronized.</span></div>
<div class="line"><a name="l02742"></a><span class="lineno"> 2742</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02743"></a><span class="lineno"> 2743</span>&#160;        <a class="code" href="a00824.html#a625f273e3c887a8cf38f78db6d144bca">ProcessUpdateKeyStateEvent</a>(pq, (PBYTE)pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam);</div>
<div class="line"><a name="l02744"></a><span class="lineno"> 2744</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02745"></a><span class="lineno"> 2745</span>&#160; </div>
<div class="line"><a name="l02746"></a><span class="lineno"> 2746</span>&#160;    <span class="keywordflow">case</span> QEVENT_ACTIVATE:</div>
<div class="line"><a name="l02747"></a><span class="lineno"> 2747</span>&#160;        <span class="keywordflow">if</span> (pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam == 0) {</div>
<div class="line"><a name="l02748"></a><span class="lineno"> 2748</span>&#160; </div>
<div class="line"><a name="l02749"></a><span class="lineno"> 2749</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02750"></a><span class="lineno"> 2750</span>&#160;<span class="comment">             * Clear any visible tracking going on in system.  We</span></div>
<div class="line"><a name="l02751"></a><span class="lineno"> 2751</span>&#160;<span class="comment">             * only bother to do this if lParam == 0 since</span></div>
<div class="line"><a name="l02752"></a><span class="lineno"> 2752</span>&#160;<span class="comment">             * xxxSetForegroundWindow2() deals with this in the</span></div>
<div class="line"><a name="l02753"></a><span class="lineno"> 2753</span>&#160;<span class="comment">             * other case.</span></div>
<div class="line"><a name="l02754"></a><span class="lineno"> 2754</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02755"></a><span class="lineno"> 2755</span>&#160;            <a class="code" href="a00800.html#a6f2b9dd1729d23941460a67c73dc1f4e">xxxCancelTracking</a>();</div>
<div class="line"><a name="l02756"></a><span class="lineno"> 2756</span>&#160; </div>
<div class="line"><a name="l02757"></a><span class="lineno"> 2757</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02758"></a><span class="lineno"> 2758</span>&#160;<span class="comment">             * Remove the clip cursor rectangle - it is a global mode that</span></div>
<div class="line"><a name="l02759"></a><span class="lineno"> 2759</span>&#160;<span class="comment">             * gets removed when switching.  Also remove any LockWindowUpdate()</span></div>
<div class="line"><a name="l02760"></a><span class="lineno"> 2760</span>&#160;<span class="comment">             * that&#39;s still around.</span></div>
<div class="line"><a name="l02761"></a><span class="lineno"> 2761</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02762"></a><span class="lineno"> 2762</span>&#160;            <a class="code" href="a00638.html#ac0816c73ec6cd096ee9436e038337f80">_ClipCursor</a>(NULL);</div>
<div class="line"><a name="l02763"></a><span class="lineno"> 2763</span>&#160;            <a class="code" href="a00860.html#a386f0678a4f1a1261f1cfd672696933a">xxxLockWindowUpdate2</a>(NULL, TRUE);</div>
<div class="line"><a name="l02764"></a><span class="lineno"> 2764</span>&#160; </div>
<div class="line"><a name="l02765"></a><span class="lineno"> 2765</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02766"></a><span class="lineno"> 2766</span>&#160;<span class="comment">             * Reload pq because it may have changed.</span></div>
<div class="line"><a name="l02767"></a><span class="lineno"> 2767</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02768"></a><span class="lineno"> 2768</span>&#160;            pq = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>;</div>
<div class="line"><a name="l02769"></a><span class="lineno"> 2769</span>&#160; </div>
<div class="line"><a name="l02770"></a><span class="lineno"> 2770</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02771"></a><span class="lineno"> 2771</span>&#160;<span class="comment">             * If this event didn&#39;t originate from an initializing app</span></div>
<div class="line"><a name="l02772"></a><span class="lineno"> 2772</span>&#160;<span class="comment">             * coming to the foreground [wParam == 0] then go ahead</span></div>
<div class="line"><a name="l02773"></a><span class="lineno"> 2773</span>&#160;<span class="comment">             * and check if there&#39;s already an active window and if so make</span></div>
<div class="line"><a name="l02774"></a><span class="lineno"> 2774</span>&#160;<span class="comment">             * it visually active.  Also make sure we&#39;re still the foreground</span></div>
<div class="line"><a name="l02775"></a><span class="lineno"> 2775</span>&#160;<span class="comment">             * queue.</span></div>
<div class="line"><a name="l02776"></a><span class="lineno"> 2776</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02777"></a><span class="lineno"> 2777</span>&#160;            <span class="keywordflow">if</span> ((pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam != 0) &amp;&amp; (pq-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a> != NULL) &amp;&amp;</div>
<div class="line"><a name="l02778"></a><span class="lineno"> 2778</span>&#160;                    (pq == <a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a>)) {</div>
<div class="line"><a name="l02779"></a><span class="lineno"> 2779</span>&#160;                <a class="code" href="a02581.html">PWND</a> pwndActive;</div>
<div class="line"><a name="l02780"></a><span class="lineno"> 2780</span>&#160; </div>
<div class="line"><a name="l02781"></a><span class="lineno"> 2781</span>&#160;                ThreadLockAlwaysWithPti(pti, pwndActive = pq-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>, &amp;tlpwndT);</div>
<div class="line"><a name="l02782"></a><span class="lineno"> 2782</span>&#160;                <a class="code" href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a>(pwndActive, WM_NCACTIVATE, TRUE, 0);</div>
<div class="line"><a name="l02783"></a><span class="lineno"> 2783</span>&#160;                <a class="code" href="a00872.html#a71170c4c5e4c60d4bc657fe52eb8d8d2">xxxSetWindowPos</a>(pwndActive, PWND_TOP, 0, 0, 0, 0, SWP_NOSIZE | SWP_NOMOVE);</div>
<div class="line"><a name="l02784"></a><span class="lineno"> 2784</span>&#160;                ThreadUnlock(&amp;tlpwndT);</div>
<div class="line"><a name="l02785"></a><span class="lineno"> 2785</span>&#160;            } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pq != <a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a>) {</div>
<div class="line"><a name="l02786"></a><span class="lineno"> 2786</span>&#160; </div>
<div class="line"><a name="l02787"></a><span class="lineno"> 2787</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l02788"></a><span class="lineno"> 2788</span>&#160;<span class="comment">                 * If we&#39;re not being activated, make sure we don&#39;t become foreground.</span></div>
<div class="line"><a name="l02789"></a><span class="lineno"> 2789</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l02790"></a><span class="lineno"> 2790</span>&#160;                pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp;= ~TIF_ALLOWFOREGROUNDACTIVATE;</div>
<div class="line"><a name="l02791"></a><span class="lineno"> 2791</span>&#160;                pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;W32PF_Flags &amp;= ~W32PF_ALLOWFOREGROUNDACTIVATE;</div>
<div class="line"><a name="l02792"></a><span class="lineno"> 2792</span>&#160;            }</div>
<div class="line"><a name="l02793"></a><span class="lineno"> 2793</span>&#160; </div>
<div class="line"><a name="l02794"></a><span class="lineno"> 2794</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02795"></a><span class="lineno"> 2795</span>&#160; </div>
<div class="line"><a name="l02796"></a><span class="lineno"> 2796</span>&#160;            pwnd = RevalidateHwnd((HWND)pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam);</div>
<div class="line"><a name="l02797"></a><span class="lineno"> 2797</span>&#160;            <span class="keywordflow">if</span> (pwnd == NULL || HMIsMarkDestroy(pwnd))</div>
<div class="line"><a name="l02798"></a><span class="lineno"> 2798</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02799"></a><span class="lineno"> 2799</span>&#160; </div>
<div class="line"><a name="l02800"></a><span class="lineno"> 2800</span>&#160;            ThreadLockAlwaysWithPti(pti, pwnd, &amp;tlpwndT);</div>
<div class="line"><a name="l02801"></a><span class="lineno"> 2801</span>&#160; </div>
<div class="line"><a name="l02802"></a><span class="lineno"> 2802</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02803"></a><span class="lineno"> 2803</span>&#160;<span class="comment">             * If nobody is foreground, allow this app to become foreground.</span></div>
<div class="line"><a name="l02804"></a><span class="lineno"> 2804</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02805"></a><span class="lineno"> 2805</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a> == NULL) {</div>
<div class="line"><a name="l02806"></a><span class="lineno"> 2806</span>&#160;                <a class="code" href="a00686.html#a16558717257c16a685cc2eaf97a67ad3">xxxSetForegroundWindow2</a>(pwnd, pti, 0);</div>
<div class="line"><a name="l02807"></a><span class="lineno"> 2807</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02808"></a><span class="lineno"> 2808</span>&#160;                <span class="keywordflow">if</span> (pwnd != pq-&gt;<a class="code" href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">spwndActive</a>) {</div>
<div class="line"><a name="l02809"></a><span class="lineno"> 2809</span>&#160;                    <a class="code" href="a00686.html#a1dc7b5d2bcb53d6272a655ff64427cb3">xxxActivateThisWindow</a>(pwnd, pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam,</div>
<div class="line"><a name="l02810"></a><span class="lineno"> 2810</span>&#160;                            (ATW_SETFOCUS | ATW_ASYNC) |</div>
<div class="line"><a name="l02811"></a><span class="lineno"> 2811</span>&#160;                            ((pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message &amp; PEM_ACTIVATE_NOZORDER) ? ATW_NOZORDER : 0));</div>
<div class="line"><a name="l02812"></a><span class="lineno"> 2812</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02813"></a><span class="lineno"> 2813</span>&#160;                    BOOL fActive = (GETPTI(pwnd)-&gt;pq == <a class="code" href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a>);</div>
<div class="line"><a name="l02814"></a><span class="lineno"> 2814</span>&#160; </div>
<div class="line"><a name="l02815"></a><span class="lineno"> 2815</span>&#160;                    <a class="code" href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a>(pwnd, WM_NCACTIVATE,</div>
<div class="line"><a name="l02816"></a><span class="lineno"> 2816</span>&#160;                            (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)(fActive), 0);</div>
<div class="line"><a name="l02817"></a><span class="lineno"> 2817</span>&#160; </div>
<div class="line"><a name="l02818"></a><span class="lineno"> 2818</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l02819"></a><span class="lineno"> 2819</span>&#160;<span class="comment">                     * Only bring the window to the top if it is becoming active.</span></div>
<div class="line"><a name="l02820"></a><span class="lineno"> 2820</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l02821"></a><span class="lineno"> 2821</span>&#160;                    <span class="keywordflow">if</span> (fActive &amp;&amp; !(pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message &amp; PEM_ACTIVATE_NOZORDER))</div>
<div class="line"><a name="l02822"></a><span class="lineno"> 2822</span>&#160;                        <a class="code" href="a00872.html#a71170c4c5e4c60d4bc657fe52eb8d8d2">xxxSetWindowPos</a>(pwnd, PWND_TOP, 0, 0, 0, 0,</div>
<div class="line"><a name="l02823"></a><span class="lineno"> 2823</span>&#160;                                SWP_NOSIZE | SWP_NOMOVE);</div>
<div class="line"><a name="l02824"></a><span class="lineno"> 2824</span>&#160;                }</div>
<div class="line"><a name="l02825"></a><span class="lineno"> 2825</span>&#160;            }</div>
<div class="line"><a name="l02826"></a><span class="lineno"> 2826</span>&#160; </div>
<div class="line"><a name="l02827"></a><span class="lineno"> 2827</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02828"></a><span class="lineno"> 2828</span>&#160;<span class="comment">             * Check here to see if the window needs to be restored. This is a</span></div>
<div class="line"><a name="l02829"></a><span class="lineno"> 2829</span>&#160;<span class="comment">             * hack so that we&#39;re compatible with what msmail expects out of</span></div>
<div class="line"><a name="l02830"></a><span class="lineno"> 2830</span>&#160;<span class="comment">             * win3.1 alt-tab. msmail expects to always be active when it gets</span></div>
<div class="line"><a name="l02831"></a><span class="lineno"> 2831</span>&#160;<span class="comment">             * asked to be restored. This will ensure that during alt-tab</span></div>
<div class="line"><a name="l02832"></a><span class="lineno"> 2832</span>&#160;<span class="comment">             * activate.</span></div>
<div class="line"><a name="l02833"></a><span class="lineno"> 2833</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02834"></a><span class="lineno"> 2834</span>&#160;            <span class="keywordflow">if</span> (pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message &amp; PEM_ACTIVATE_RESTORE) {</div>
<div class="line"><a name="l02835"></a><span class="lineno"> 2835</span>&#160;                <span class="keywordflow">if</span> (TestWF(pwnd, WFMINIMIZED)) {</div>
<div class="line"><a name="l02836"></a><span class="lineno"> 2836</span>&#160;                    <a class="code" href="a00257.html#a933a4a4818762a03428fe021dd9772a4">_PostMessage</a>(pwnd, WM_SYSCOMMAND, SC_RESTORE, 0);</div>
<div class="line"><a name="l02837"></a><span class="lineno"> 2837</span>&#160;                }</div>
<div class="line"><a name="l02838"></a><span class="lineno"> 2838</span>&#160;            }</div>
<div class="line"><a name="l02839"></a><span class="lineno"> 2839</span>&#160; </div>
<div class="line"><a name="l02840"></a><span class="lineno"> 2840</span>&#160;            ThreadUnlock(&amp;tlpwndT);</div>
<div class="line"><a name="l02841"></a><span class="lineno"> 2841</span>&#160;        }</div>
<div class="line"><a name="l02842"></a><span class="lineno"> 2842</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02843"></a><span class="lineno"> 2843</span>&#160; </div>
<div class="line"><a name="l02844"></a><span class="lineno"> 2844</span>&#160;    <span class="keywordflow">case</span> QEVENT_DEACTIVATE:</div>
<div class="line"><a name="l02845"></a><span class="lineno"> 2845</span>&#160;        <a class="code" href="a00686.html#a32ce9762c0f32576f47ce0d6bc239f04">xxxDeactivate</a>(pti, (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam);</div>
<div class="line"><a name="l02846"></a><span class="lineno"> 2846</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02847"></a><span class="lineno"> 2847</span>&#160; </div>
<div class="line"><a name="l02848"></a><span class="lineno"> 2848</span>&#160;    <span class="keywordflow">case</span> QEVENT_CANCELMODE:</div>
<div class="line"><a name="l02849"></a><span class="lineno"> 2849</span>&#160;        <span class="keywordflow">if</span> (pq-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a> != NULL) {</div>
<div class="line"><a name="l02850"></a><span class="lineno"> 2850</span>&#160;            ThreadLockAlwaysWithPti(pti, pq-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a>, &amp;tlpwndT);</div>
<div class="line"><a name="l02851"></a><span class="lineno"> 2851</span>&#160;            <a class="code" href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a>(pq-&gt;<a class="code" href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">spwndCapture</a>, WM_CANCELMODE, 0, 0);</div>
<div class="line"><a name="l02852"></a><span class="lineno"> 2852</span>&#160;            ThreadUnlock(&amp;tlpwndT);</div>
<div class="line"><a name="l02853"></a><span class="lineno"> 2853</span>&#160; </div>
<div class="line"><a name="l02854"></a><span class="lineno"> 2854</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l02855"></a><span class="lineno"> 2855</span>&#160;<span class="comment">             * Set QS_MOUSEMOVE so any sleeping modal loops,</span></div>
<div class="line"><a name="l02856"></a><span class="lineno"> 2856</span>&#160;<span class="comment">             * like the move/size code, will wake up and figure</span></div>
<div class="line"><a name="l02857"></a><span class="lineno"> 2857</span>&#160;<span class="comment">             * out that it should abort.</span></div>
<div class="line"><a name="l02858"></a><span class="lineno"> 2858</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l02859"></a><span class="lineno"> 2859</span>&#160;            <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(pti, QS_MOUSEMOVE);</div>
<div class="line"><a name="l02860"></a><span class="lineno"> 2860</span>&#160;        }</div>
<div class="line"><a name="l02861"></a><span class="lineno"> 2861</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02862"></a><span class="lineno"> 2862</span>&#160; </div>
<div class="line"><a name="l02863"></a><span class="lineno"> 2863</span>&#160; </div>
<div class="line"><a name="l02864"></a><span class="lineno"> 2864</span>&#160;    <span class="keywordflow">case</span> QEVENT_POSTMESSAGE:</div>
<div class="line"><a name="l02865"></a><span class="lineno"> 2865</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l02866"></a><span class="lineno"> 2866</span>&#160;<span class="comment">         * This event is used in situations where we need to ensure that posted</span></div>
<div class="line"><a name="l02867"></a><span class="lineno"> 2867</span>&#160;<span class="comment">         * messages are processed after previous QEVENT&#39;s.  Normally, posting a</span></div>
<div class="line"><a name="l02868"></a><span class="lineno"> 2868</span>&#160;<span class="comment">         * queue event and then calling postmessage will result in the posted</span></div>
<div class="line"><a name="l02869"></a><span class="lineno"> 2869</span>&#160;<span class="comment">         * message being seen first by the app (because posted messages are</span></div>
<div class="line"><a name="l02870"></a><span class="lineno"> 2870</span>&#160;<span class="comment">         * processed before input.) Instead we will post a QEVENT_POSTMESSAGE</span></div>
<div class="line"><a name="l02871"></a><span class="lineno"> 2871</span>&#160;<span class="comment">         * instead of doing a postmessage directly, which will result in the</span></div>
<div class="line"><a name="l02872"></a><span class="lineno"> 2872</span>&#160;<span class="comment">         * correct ordering of messages.</span></div>
<div class="line"><a name="l02873"></a><span class="lineno"> 2873</span>&#160;<span class="comment">         *</span></div>
<div class="line"><a name="l02874"></a><span class="lineno"> 2874</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l02875"></a><span class="lineno"> 2875</span>&#160; </div>
<div class="line"><a name="l02876"></a><span class="lineno"> 2876</span>&#160;        <span class="keywordflow">if</span> (pwnd = RevalidateHwnd((HWND)pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.hwnd)) {</div>
<div class="line"><a name="l02877"></a><span class="lineno"> 2877</span>&#160; </div>
<div class="line"><a name="l02878"></a><span class="lineno"> 2878</span>&#160;            <a class="code" href="a00257.html#a933a4a4818762a03428fe021dd9772a4">_PostMessage</a>(pwnd,pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message,pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam,pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam);</div>
<div class="line"><a name="l02879"></a><span class="lineno"> 2879</span>&#160;        }</div>
<div class="line"><a name="l02880"></a><span class="lineno"> 2880</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02881"></a><span class="lineno"> 2881</span>&#160; </div>
<div class="line"><a name="l02882"></a><span class="lineno"> 2882</span>&#160; </div>
<div class="line"><a name="l02883"></a><span class="lineno"> 2883</span>&#160;    <span class="keywordflow">case</span> QEVENT_ASYNCSENDMSG:</div>
<div class="line"><a name="l02884"></a><span class="lineno"> 2884</span>&#160;        <a class="code" href="a00842.html#a69520c6e8309eb271485683d2bae262a">xxxProcessAsyncSendMessage</a>((<a class="code" href="a02953.html">PASYNCSENDMSG</a>)pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam);</div>
<div class="line"><a name="l02885"></a><span class="lineno"> 2885</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l02886"></a><span class="lineno"> 2886</span>&#160;    }</div>
<div class="line"><a name="l02887"></a><span class="lineno"> 2887</span>&#160;}</div>
<div class="line"><a name="l02888"></a><span class="lineno"> 2888</span>&#160; </div>
<div class="line"><a name="l02889"></a><span class="lineno"> 2889</span>&#160; </div>
<div class="line"><a name="l02898"></a><span class="lineno"><a class="line" href="a00824.html#a7255c4dd66972cb39b71e2c8835bd3f2"> 2898</a></span>&#160;<span class="preprocessor">#define QS_TEST_AND_CLEAR (QS_INPUT | QS_POSTMESSAGE | QS_TIMER | QS_PAINT | QS_SENDMESSAGE)</span></div>
<div class="line"><a name="l02899"></a><span class="lineno"><a class="line" href="a00824.html#a24c1969f4f02b8e86ffabb0c86f94851"> 2899</a></span>&#160;<span class="preprocessor">#define QS_TEST           (QS_MOUSEBUTTON | QS_KEY)</span></div>
<div class="line"><a name="l02900"></a><span class="lineno"> 2900</span>&#160; </div>
<div class="line"><a name="l02901"></a><span class="lineno"><a class="line" href="a00899.html#a869d0d6d1e05b9dfc0ad12d8bbc2408e"> 2901</a></span>&#160;BOOL <a class="code" href="a00824.html#a869d0d6d1e05b9dfc0ad12d8bbc2408e">_GetInputState</a>(VOID)</div>
<div class="line"><a name="l02902"></a><span class="lineno"> 2902</span>&#160;{</div>
<div class="line"><a name="l02903"></a><span class="lineno"> 2903</span>&#160;    <span class="keywordflow">if</span> (LOWORD(<a class="code" href="a00824.html#a43a6d16b48d2a6a3ed35b58340125b68">_GetQueueStatus</a>(<a class="code" href="a00824.html#a7255c4dd66972cb39b71e2c8835bd3f2">QS_TEST_AND_CLEAR</a>)) &amp; <a class="code" href="a00824.html#a24c1969f4f02b8e86ffabb0c86f94851">QS_TEST</a>) {</div>
<div class="line"><a name="l02904"></a><span class="lineno"> 2904</span>&#160;        <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l02905"></a><span class="lineno"> 2905</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l02906"></a><span class="lineno"> 2906</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l02907"></a><span class="lineno"> 2907</span>&#160;    }</div>
<div class="line"><a name="l02908"></a><span class="lineno"> 2908</span>&#160;}</div>
<div class="line"><a name="l02909"></a><span class="lineno"> 2909</span>&#160; </div>
<div class="line"><a name="l02910"></a><span class="lineno"> 2910</span>&#160;<span class="preprocessor">#undef QS_TEST_AND_CLEAR</span></div>
<div class="line"><a name="l02911"></a><span class="lineno"> 2911</span>&#160;<span class="preprocessor">#undef QS_TEST</span></div>
<div class="line"><a name="l02912"></a><span class="lineno"> 2912</span>&#160; </div>
<div class="line"><a name="l02913"></a><span class="lineno"> 2913</span>&#160; </div>
<div class="line"><a name="l02923"></a><span class="lineno"><a class="line" href="a00899.html#a4dfa1a1618b98cb7af2a75bc81c31ecc"> 2923</a></span>&#160;<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> <a class="code" href="a00824.html#a43a6d16b48d2a6a3ed35b58340125b68">_GetQueueStatus</a>(</div>
<div class="line"><a name="l02924"></a><span class="lineno"> 2924</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> flags)</div>
<div class="line"><a name="l02925"></a><span class="lineno"> 2925</span>&#160;{</div>
<div class="line"><a name="l02926"></a><span class="lineno"> 2926</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l02927"></a><span class="lineno"> 2927</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> fsChangeBits;</div>
<div class="line"><a name="l02928"></a><span class="lineno"> 2928</span>&#160; </div>
<div class="line"><a name="l02929"></a><span class="lineno"> 2929</span>&#160;    pti = PtiCurrentShared();</div>
<div class="line"><a name="l02930"></a><span class="lineno"> 2930</span>&#160; </div>
<div class="line"><a name="l02931"></a><span class="lineno"> 2931</span>&#160;    flags &amp;= (QS_ALLINPUT | QS_ALLPOSTMESSAGE | QS_TRANSFER);</div>
<div class="line"><a name="l02932"></a><span class="lineno"> 2932</span>&#160; </div>
<div class="line"><a name="l02933"></a><span class="lineno"> 2933</span>&#160;    fsChangeBits = pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a>;</div>
<div class="line"><a name="l02934"></a><span class="lineno"> 2934</span>&#160; </div>
<div class="line"><a name="l02935"></a><span class="lineno"> 2935</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02936"></a><span class="lineno"> 2936</span>&#160;<span class="comment">     * Clear out the change bits the app is looking at</span></div>
<div class="line"><a name="l02937"></a><span class="lineno"> 2937</span>&#160;<span class="comment">     * so it&#39;ll know what changed since it&#39;s last call</span></div>
<div class="line"><a name="l02938"></a><span class="lineno"> 2938</span>&#160;<span class="comment">     * to GetQueueStatus().</span></div>
<div class="line"><a name="l02939"></a><span class="lineno"> 2939</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02940"></a><span class="lineno"> 2940</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> &amp;= ~flags;</div>
<div class="line"><a name="l02941"></a><span class="lineno"> 2941</span>&#160; </div>
<div class="line"><a name="l02942"></a><span class="lineno"> 2942</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02943"></a><span class="lineno"> 2943</span>&#160;<span class="comment">     * Return the current change/wake-bits.</span></div>
<div class="line"><a name="l02944"></a><span class="lineno"> 2944</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02945"></a><span class="lineno"> 2945</span>&#160;    <span class="keywordflow">return</span> MAKELONG(fsChangeBits &amp; flags,</div>
<div class="line"><a name="l02946"></a><span class="lineno"> 2946</span>&#160;            (pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> | pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#ad7384d5f6cca06e0d245aaa350ba6e22">fsWakeBitsJournal</a>) &amp; flags);</div>
<div class="line"><a name="l02947"></a><span class="lineno"> 2947</span>&#160;}</div>
<div class="line"><a name="l02948"></a><span class="lineno"> 2948</span>&#160; </div>
<div class="line"><a name="l02949"></a><span class="lineno"> 2949</span>&#160; </div>
<div class="line"><a name="l02962"></a><span class="lineno"> 2962</span>&#160;<span class="preprocessor">#ifdef LOCK_MOUSE_CODE</span></div>
<div class="line"><a name="l02963"></a><span class="lineno"> 2963</span>&#160;<span class="preprocessor">#pragma alloc_text(MOUSE, xxxMsgWaitForMultipleObjects)</span></div>
<div class="line"><a name="l02964"></a><span class="lineno"> 2964</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l02965"></a><span class="lineno"> 2965</span>&#160; </div>
<div class="line"><a name="l02966"></a><span class="lineno"><a class="line" href="a00899.html#a1edc88fad519f1c6daaf9b6b2a6f8b65"> 2966</a></span>&#160;<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> <a class="code" href="a00824.html#a1edc88fad519f1c6daaf9b6b2a6f8b65">xxxMsgWaitForMultipleObjects</a>(</div>
<div class="line"><a name="l02967"></a><span class="lineno"> 2967</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> nCount,</div>
<div class="line"><a name="l02968"></a><span class="lineno"> 2968</span>&#160;    PVOID *<a class="code" href="a00809.html#ae1f04171d74f1a21b487af2a34922aa8">apObjects</a>,</div>
<div class="line"><a name="l02969"></a><span class="lineno"> 2969</span>&#160;    BOOL fWaitAll,</div>
<div class="line"><a name="l02970"></a><span class="lineno"> 2970</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwMilliseconds,</div>
<div class="line"><a name="l02971"></a><span class="lineno"> 2971</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwWakeMask,</div>
<div class="line"><a name="l02972"></a><span class="lineno"> 2972</span>&#160;    <a class="code" href="a00899.html#a710dc7b3a0a3fbfe00315b133ab633de">MSGWAITCALLBACK</a> pfnNonMsg)</div>
<div class="line"><a name="l02973"></a><span class="lineno"> 2973</span>&#160;{</div>
<div class="line"><a name="l02974"></a><span class="lineno"> 2974</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l02975"></a><span class="lineno"> 2975</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l02976"></a><span class="lineno"> 2976</span>&#160;    LARGE_INTEGER li;</div>
<div class="line"><a name="l02977"></a><span class="lineno"> 2977</span>&#160; </div>
<div class="line"><a name="l02978"></a><span class="lineno"> 2978</span>&#160;    pti = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l02979"></a><span class="lineno"> 2979</span>&#160; </div>
<div class="line"><a name="l02980"></a><span class="lineno"> 2980</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02981"></a><span class="lineno"> 2981</span>&#160;<span class="comment">     * Setup the wake mask for this thread. Wait for QS_EVENT or the app won&#39;t</span></div>
<div class="line"><a name="l02982"></a><span class="lineno"> 2982</span>&#160;<span class="comment">     * get event messages like deactivate.</span></div>
<div class="line"><a name="l02983"></a><span class="lineno"> 2983</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02984"></a><span class="lineno"> 2984</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#aa1082b32678ff0e6f4d076c83458e1ca">fsWakeMask</a> = (<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>)dwWakeMask | QS_EVENT;</div>
<div class="line"><a name="l02985"></a><span class="lineno"> 2985</span>&#160; </div>
<div class="line"><a name="l02986"></a><span class="lineno"> 2986</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02987"></a><span class="lineno"> 2987</span>&#160;<span class="comment">     * Stuff the event handle for the current queue at the end.</span></div>
<div class="line"><a name="l02988"></a><span class="lineno"> 2988</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02989"></a><span class="lineno"> 2989</span>&#160;    <a class="code" href="a00809.html#ae1f04171d74f1a21b487af2a34922aa8">apObjects</a>[nCount] = pti-&gt;<a class="code" href="a02889.html#a64da47920250096684c62e566c661139">pEventQueueServer</a>;</div>
<div class="line"><a name="l02990"></a><span class="lineno"> 2990</span>&#160;    KeClearEvent(pti-&gt;<a class="code" href="a02889.html#a64da47920250096684c62e566c661139">pEventQueueServer</a>);</div>
<div class="line"><a name="l02991"></a><span class="lineno"> 2991</span>&#160; </div>
<div class="line"><a name="l02992"></a><span class="lineno"> 2992</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02993"></a><span class="lineno"> 2993</span>&#160;<span class="comment">     * Convert dwMilliseconds to a relative-time(i.e.  negative) LARGE_INTEGER.</span></div>
<div class="line"><a name="l02994"></a><span class="lineno"> 2994</span>&#160;<span class="comment">     * NT Base calls take time values in 100 nanosecond units.</span></div>
<div class="line"><a name="l02995"></a><span class="lineno"> 2995</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l02996"></a><span class="lineno"> 2996</span>&#160;    li.QuadPart = Int32x32To64(-10000, dwMilliseconds);</div>
<div class="line"><a name="l02997"></a><span class="lineno"> 2997</span>&#160; </div>
<div class="line"><a name="l02998"></a><span class="lineno"> 2998</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l02999"></a><span class="lineno"> 2999</span>&#160;<span class="comment">     * Check to see if any input came inbetween when we</span></div>
<div class="line"><a name="l03000"></a><span class="lineno"> 3000</span>&#160;<span class="comment">     * last checked and the NtClearEvent() call.</span></div>
<div class="line"><a name="l03001"></a><span class="lineno"> 3001</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03002"></a><span class="lineno"> 3002</span>&#160;    <span class="keywordflow">if</span> (!(pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> &amp; (<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>)dwWakeMask)) {</div>
<div class="line"><a name="l03003"></a><span class="lineno"> 3003</span>&#160; </div>
<div class="line"><a name="l03004"></a><span class="lineno"> 3004</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03005"></a><span class="lineno"> 3005</span>&#160;<span class="comment">         * This app is going idle. Clear the spin count check to see</span></div>
<div class="line"><a name="l03006"></a><span class="lineno"> 3006</span>&#160;<span class="comment">         * if we need to make this process foreground again.</span></div>
<div class="line"><a name="l03007"></a><span class="lineno"> 3007</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03008"></a><span class="lineno"> 3008</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SPINNING) {</div>
<div class="line"><a name="l03009"></a><span class="lineno"> 3009</span>&#160;            <a class="code" href="a00824.html#acbf7182e6530b750eed27ef83e03c85f">CheckProcessForeground</a>(pti);</div>
<div class="line"><a name="l03010"></a><span class="lineno"> 3010</span>&#160;        }</div>
<div class="line"><a name="l03011"></a><span class="lineno"> 3011</span>&#160;        pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a79413d59e46650132a5add64bfd87791">cSpins</a> = 0;</div>
<div class="line"><a name="l03012"></a><span class="lineno"> 3012</span>&#160; </div>
<div class="line"><a name="l03013"></a><span class="lineno"> 3013</span>&#160;        <span class="keywordflow">if</span> (pti == <a class="code" href="a03257.html#a72d6c69b0eefb30311d982761970b971">gptiForeground</a> &amp;&amp;</div>
<div class="line"><a name="l03014"></a><span class="lineno"> 3014</span>&#160;                IsHooked(pti, WHF_FOREGROUNDIDLE)) {</div>
<div class="line"><a name="l03015"></a><span class="lineno"> 3015</span>&#160;            <a class="code" href="a00701.html#a4a596c02b66f7f049c18711b882e0b89">xxxCallHook</a>(HC_ACTION, 0, 0, WH_FOREGROUNDIDLE);</div>
<div class="line"><a name="l03016"></a><span class="lineno"> 3016</span>&#160;        }</div>
<div class="line"><a name="l03017"></a><span class="lineno"> 3017</span>&#160; </div>
<div class="line"><a name="l03018"></a><span class="lineno"> 3018</span>&#160;        CheckForClientDeath();</div>
<div class="line"><a name="l03019"></a><span class="lineno"> 3019</span>&#160; </div>
<div class="line"><a name="l03020"></a><span class="lineno"> 3020</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03021"></a><span class="lineno"> 3021</span>&#160;<span class="comment">         * Set the input idle event to wake up any threads waiting</span></div>
<div class="line"><a name="l03022"></a><span class="lineno"> 3022</span>&#160;<span class="comment">         * for this thread to go into idle state.</span></div>
<div class="line"><a name="l03023"></a><span class="lineno"> 3023</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03024"></a><span class="lineno"> 3024</span>&#160;        <a class="code" href="a03290.html#adc158fd691fd8f38a443ca9a299b1632">WakeInputIdle</a>(pti);</div>
<div class="line"><a name="l03025"></a><span class="lineno"> 3025</span>&#160; </div>
<div class="line"><a name="l03026"></a><span class="lineno"> 3026</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03027"></a><span class="lineno"> 3027</span>&#160;<span class="comment">         * Wow Tasks MUST be descheduled while in the wait to allow</span></div>
<div class="line"><a name="l03028"></a><span class="lineno"> 3028</span>&#160;<span class="comment">         * other tasks in the same wow scheduler to run.</span></div>
<div class="line"><a name="l03029"></a><span class="lineno"> 3029</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03030"></a><span class="lineno"> 3030</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT) {</div>
<div class="line"><a name="l03031"></a><span class="lineno"> 3031</span>&#160;            <a class="code" href="a00881.html#ae11878514dabd4ba1a2c58dd2bcf2d4d">xxxSleepTask</a>(FALSE, HEVENT_REMOVEME);</div>
<div class="line"><a name="l03032"></a><span class="lineno"> 3032</span>&#160;            <span class="comment">// caution: the wow task is no longer scheduled.</span></div>
<div class="line"><a name="l03033"></a><span class="lineno"> 3033</span>&#160;        }</div>
<div class="line"><a name="l03034"></a><span class="lineno"> 3034</span>&#160; </div>
<div class="line"><a name="l03035"></a><span class="lineno"> 3035</span>&#160;        <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l03036"></a><span class="lineno"> 3036</span>&#160; </div>
<div class="line"><a name="l03037"></a><span class="lineno"> 3037</span>&#160;Again:</div>
<div class="line"><a name="l03038"></a><span class="lineno"> 3038</span>&#160;        Status = KeWaitForMultipleObjects(nCount + 1, <a class="code" href="a00809.html#ae1f04171d74f1a21b487af2a34922aa8">apObjects</a>,</div>
<div class="line"><a name="l03039"></a><span class="lineno"> 3039</span>&#160;                fWaitAll ? WaitAll : WaitAny, WrUserRequest,</div>
<div class="line"><a name="l03040"></a><span class="lineno"> 3040</span>&#160;                UserMode, FALSE,</div>
<div class="line"><a name="l03041"></a><span class="lineno"> 3041</span>&#160;                (dwMilliseconds == INFINITE ? NULL : &amp;li), NULL);</div>
<div class="line"><a name="l03042"></a><span class="lineno"> 3042</span>&#160; </div>
<div class="line"><a name="l03043"></a><span class="lineno"> 3043</span>&#160;        CheckForClientDeath();</div>
<div class="line"><a name="l03044"></a><span class="lineno"> 3044</span>&#160; </div>
<div class="line"><a name="l03045"></a><span class="lineno"> 3045</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(NT_SUCCESS(Status));</div>
<div class="line"><a name="l03046"></a><span class="lineno"> 3046</span>&#160; </div>
<div class="line"><a name="l03047"></a><span class="lineno"> 3047</span>&#160;        <span class="keywordflow">if</span> ((Status == STATUS_WAIT_0) &amp;&amp;</div>
<div class="line"><a name="l03048"></a><span class="lineno"> 3048</span>&#160;                (pfnNonMsg != NULL)) {</div>
<div class="line"><a name="l03049"></a><span class="lineno"> 3049</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03050"></a><span class="lineno"> 3050</span>&#160;<span class="comment">             * Call pfnNonMsg for the first event</span></div>
<div class="line"><a name="l03051"></a><span class="lineno"> 3051</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03052"></a><span class="lineno"> 3052</span>&#160;            pfnNonMsg();</div>
<div class="line"><a name="l03053"></a><span class="lineno"> 3053</span>&#160;            <span class="keywordflow">goto</span> Again;</div>
<div class="line"><a name="l03054"></a><span class="lineno"> 3054</span>&#160;        }</div>
<div class="line"><a name="l03055"></a><span class="lineno"> 3055</span>&#160; </div>
<div class="line"><a name="l03056"></a><span class="lineno"> 3056</span>&#160;        <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l03057"></a><span class="lineno"> 3057</span>&#160;        <span class="keywordflow">if</span> (Status == (NTSTATUS)(STATUS_WAIT_0 + nCount)) {</div>
<div class="line"><a name="l03058"></a><span class="lineno"> 3058</span>&#160; </div>
<div class="line"><a name="l03059"></a><span class="lineno"> 3059</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03060"></a><span class="lineno"> 3060</span>&#160;<span class="comment">             *  WOW tasks, wait to be rescheduled</span></div>
<div class="line"><a name="l03061"></a><span class="lineno"> 3061</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03062"></a><span class="lineno"> 3062</span>&#160;            <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT) {</div>
<div class="line"><a name="l03063"></a><span class="lineno"> 3063</span>&#160;                <a class="code" href="a00881.html#a16f932bda409a22bfb319067daffc1a1">xxxDirectedYield</a>(DY_OLDYIELD);</div>
<div class="line"><a name="l03064"></a><span class="lineno"> 3064</span>&#160;            }</div>
<div class="line"><a name="l03065"></a><span class="lineno"> 3065</span>&#160; </div>
<div class="line"><a name="l03066"></a><span class="lineno"> 3066</span>&#160; </div>
<div class="line"><a name="l03067"></a><span class="lineno"> 3067</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03068"></a><span class="lineno"> 3068</span>&#160;<span class="comment">             * Reset the input idle event to block and threads waiting</span></div>
<div class="line"><a name="l03069"></a><span class="lineno"> 3069</span>&#160;<span class="comment">             * for this thread to go into idle state.</span></div>
<div class="line"><a name="l03070"></a><span class="lineno"> 3070</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03071"></a><span class="lineno"> 3071</span>&#160;            <a class="code" href="a03290.html#a51ccaa0d03e99d3be71c4ac54a262154">SleepInputIdle</a>(pti);</div>
<div class="line"><a name="l03072"></a><span class="lineno"> 3072</span>&#160;        }</div>
<div class="line"><a name="l03073"></a><span class="lineno"> 3073</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03074"></a><span class="lineno"> 3074</span>&#160;        Status = nCount;</div>
<div class="line"><a name="l03075"></a><span class="lineno"> 3075</span>&#160;    }</div>
<div class="line"><a name="l03076"></a><span class="lineno"> 3076</span>&#160; </div>
<div class="line"><a name="l03077"></a><span class="lineno"> 3077</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03078"></a><span class="lineno"> 3078</span>&#160;<span class="comment">     * Clear fsWakeMask since we&#39;re no longer waiting on the queue.</span></div>
<div class="line"><a name="l03079"></a><span class="lineno"> 3079</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03080"></a><span class="lineno"> 3080</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#aa1082b32678ff0e6f4d076c83458e1ca">fsWakeMask</a> = 0;</div>
<div class="line"><a name="l03081"></a><span class="lineno"> 3081</span>&#160; </div>
<div class="line"><a name="l03082"></a><span class="lineno"> 3082</span>&#160;    <span class="keywordflow">return</span> (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)Status;</div>
<div class="line"><a name="l03083"></a><span class="lineno"> 3083</span>&#160;}</div>
<div class="line"><a name="l03084"></a><span class="lineno"> 3084</span>&#160; </div>
<div class="line"><a name="l03085"></a><span class="lineno"> 3085</span>&#160; </div>
<div class="line"><a name="l03086"></a><span class="lineno"> 3086</span>&#160; </div>
<div class="line"><a name="l03096"></a><span class="lineno"><a class="line" href="a00899.html#a3930ea303180cb01a5ccbaa8a08676c2"> 3096</a></span>&#160;BOOL <a class="code" href="a00824.html#a9fdadf9722ab6b6f80c2f840f95b2fd3">xxxSleepThread</a>(</div>
<div class="line"><a name="l03097"></a><span class="lineno"> 3097</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> fsWakeMask,</div>
<div class="line"><a name="l03098"></a><span class="lineno"> 3098</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> Timeout,</div>
<div class="line"><a name="l03099"></a><span class="lineno"> 3099</span>&#160;    BOOL fInputIdle)</div>
<div class="line"><a name="l03100"></a><span class="lineno"> 3100</span>&#160;{</div>
<div class="line"><a name="l03101"></a><span class="lineno"> 3101</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l03102"></a><span class="lineno"> 3102</span>&#160;    LARGE_INTEGER li, *pli;</div>
<div class="line"><a name="l03103"></a><span class="lineno"> 3103</span>&#160;    NTSTATUS status = STATUS_SUCCESS;</div>
<div class="line"><a name="l03104"></a><span class="lineno"> 3104</span>&#160;    BOOL fExclusive = fsWakeMask &amp; QS_EXCLUSIVE;</div>
<div class="line"><a name="l03105"></a><span class="lineno"> 3105</span>&#160; </div>
<div class="line"><a name="l03106"></a><span class="lineno"> 3106</span>&#160;    <span class="keywordflow">if</span> (fExclusive) {</div>
<div class="line"><a name="l03107"></a><span class="lineno"> 3107</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03108"></a><span class="lineno"> 3108</span>&#160;<span class="comment">         * the exclusive bit is a &#39;dummy&#39; arg, turn it off to</span></div>
<div class="line"><a name="l03109"></a><span class="lineno"> 3109</span>&#160;<span class="comment">         * avoid any possible conflictions</span></div>
<div class="line"><a name="l03110"></a><span class="lineno"> 3110</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03111"></a><span class="lineno"> 3111</span>&#160;        fsWakeMask = fsWakeMask &amp; ~QS_EXCLUSIVE;</div>
<div class="line"><a name="l03112"></a><span class="lineno"> 3112</span>&#160;    }</div>
<div class="line"><a name="l03113"></a><span class="lineno"> 3113</span>&#160; </div>
<div class="line"><a name="l03114"></a><span class="lineno"> 3114</span>&#160;    <span class="keywordflow">if</span> (Timeout) {</div>
<div class="line"><a name="l03115"></a><span class="lineno"> 3115</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03116"></a><span class="lineno"> 3116</span>&#160;<span class="comment">         * Convert dwMilliseconds to a relative-time(i.e.  negative)</span></div>
<div class="line"><a name="l03117"></a><span class="lineno"> 3117</span>&#160;<span class="comment">         * LARGE_INTEGER.  NT Base calls take time values in 100 nanosecond</span></div>
<div class="line"><a name="l03118"></a><span class="lineno"> 3118</span>&#160;<span class="comment">         * units.</span></div>
<div class="line"><a name="l03119"></a><span class="lineno"> 3119</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03120"></a><span class="lineno"> 3120</span>&#160;        li.QuadPart = Int32x32To64(-10000, Timeout);</div>
<div class="line"><a name="l03121"></a><span class="lineno"> 3121</span>&#160;        pli = &amp;li;</div>
<div class="line"><a name="l03122"></a><span class="lineno"> 3122</span>&#160;    } <span class="keywordflow">else</span></div>
<div class="line"><a name="l03123"></a><span class="lineno"> 3123</span>&#160;        pli = NULL;</div>
<div class="line"><a name="l03124"></a><span class="lineno"> 3124</span>&#160; </div>
<div class="line"><a name="l03125"></a><span class="lineno"> 3125</span>&#160;    CheckCritIn();</div>
<div class="line"><a name="l03126"></a><span class="lineno"> 3126</span>&#160; </div>
<div class="line"><a name="l03127"></a><span class="lineno"> 3127</span>&#160;    pti = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l03128"></a><span class="lineno"> 3128</span>&#160; </div>
<div class="line"><a name="l03129"></a><span class="lineno"> 3129</span>&#160;    <span class="keywordflow">while</span> (TRUE) {</div>
<div class="line"><a name="l03130"></a><span class="lineno"> 3130</span>&#160; </div>
<div class="line"><a name="l03131"></a><span class="lineno"> 3131</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03132"></a><span class="lineno"> 3132</span>&#160;<span class="comment">         * First check if the input has arrived.</span></div>
<div class="line"><a name="l03133"></a><span class="lineno"> 3133</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03134"></a><span class="lineno"> 3134</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> &amp; fsWakeMask) {</div>
<div class="line"><a name="l03135"></a><span class="lineno"> 3135</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03136"></a><span class="lineno"> 3136</span>&#160;<span class="comment">             * Clear fsWakeMask since we&#39;re no longer waiting on the queue.</span></div>
<div class="line"><a name="l03137"></a><span class="lineno"> 3137</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03138"></a><span class="lineno"> 3138</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#aa1082b32678ff0e6f4d076c83458e1ca">fsWakeMask</a> = 0;</div>
<div class="line"><a name="l03139"></a><span class="lineno"> 3139</span>&#160; </div>
<div class="line"><a name="l03140"></a><span class="lineno"> 3140</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03141"></a><span class="lineno"> 3141</span>&#160;<span class="comment">             * Update timeLastRead - it is used for hung app calculations.</span></div>
<div class="line"><a name="l03142"></a><span class="lineno"> 3142</span>&#160;<span class="comment">             * If the thread is waking up to process input, it isn&#39;t hung!</span></div>
<div class="line"><a name="l03143"></a><span class="lineno"> 3143</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03144"></a><span class="lineno"> 3144</span>&#160;            SET_TIME_LAST_READ(pti);</div>
<div class="line"><a name="l03145"></a><span class="lineno"> 3145</span>&#160;            <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l03146"></a><span class="lineno"> 3146</span>&#160;        }</div>
<div class="line"><a name="l03147"></a><span class="lineno"> 3147</span>&#160; </div>
<div class="line"><a name="l03148"></a><span class="lineno"> 3148</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03149"></a><span class="lineno"> 3149</span>&#160;<span class="comment">         * Next check for SendMessages</span></div>
<div class="line"><a name="l03150"></a><span class="lineno"> 3150</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03151"></a><span class="lineno"> 3151</span>&#160;        <span class="keywordflow">if</span> (!fExclusive &amp;&amp; pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp; QS_SENDMESSAGE) {</div>
<div class="line"><a name="l03152"></a><span class="lineno"> 3152</span>&#160;            xxxReceiveMessages(pti);</div>
<div class="line"><a name="l03153"></a><span class="lineno"> 3153</span>&#160; </div>
<div class="line"><a name="l03154"></a><span class="lineno"> 3154</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03155"></a><span class="lineno"> 3155</span>&#160;<span class="comment">             * Restore the change bits we took out in PeekMessage()</span></div>
<div class="line"><a name="l03156"></a><span class="lineno"> 3156</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03157"></a><span class="lineno"> 3157</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> |= (pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp; pti-&gt;<a class="code" href="a02889.html#a3f4ef466a82433ef538cc8a35f4d0907">fsChangeBitsRemoved</a>);</div>
<div class="line"><a name="l03158"></a><span class="lineno"> 3158</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a3f4ef466a82433ef538cc8a35f4d0907">fsChangeBitsRemoved</a> = 0;</div>
<div class="line"><a name="l03159"></a><span class="lineno"> 3159</span>&#160;        }</div>
<div class="line"><a name="l03160"></a><span class="lineno"> 3160</span>&#160; </div>
<div class="line"><a name="l03161"></a><span class="lineno"> 3161</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03162"></a><span class="lineno"> 3162</span>&#160;<span class="comment">         * Check to see if some resources need expunging.</span></div>
<div class="line"><a name="l03163"></a><span class="lineno"> 3163</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03164"></a><span class="lineno"> 3164</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a8c47e61ad8490b0e1589fce16938e69f">cSysExpunge</a> != <a class="code" href="a03257.html#a0505c3ff32d34e510caf737f5fb72826">gcSysExpunge</a>) {</div>
<div class="line"><a name="l03165"></a><span class="lineno"> 3165</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a8c47e61ad8490b0e1589fce16938e69f">cSysExpunge</a> = <a class="code" href="a03257.html#a0505c3ff32d34e510caf737f5fb72826">gcSysExpunge</a>;</div>
<div class="line"><a name="l03166"></a><span class="lineno"> 3166</span>&#160;            <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a2005bba2f650d045ed083841bfeb9648">dwhmodLibLoadedMask</a> &amp; <a class="code" href="a03257.html#ae6141080cfca7976a545c46fa30d5401">gdwSysExpungeMask</a>)</div>
<div class="line"><a name="l03167"></a><span class="lineno"> 3167</span>&#160;                <a class="code" href="a00737.html#a9a296006325773dbd9cc92a586007c34">xxxDoSysExpunge</a>(pti);</div>
<div class="line"><a name="l03168"></a><span class="lineno"> 3168</span>&#160;        }</div>
<div class="line"><a name="l03169"></a><span class="lineno"> 3169</span>&#160; </div>
<div class="line"><a name="l03170"></a><span class="lineno"> 3170</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03171"></a><span class="lineno"> 3171</span>&#160;<span class="comment">         * OR QS_SENDMESSAGE in since ReceiveMessage() will end up</span></div>
<div class="line"><a name="l03172"></a><span class="lineno"> 3172</span>&#160;<span class="comment">         * trashing pq-&gt;fsWakeMask.  Do the same for QS_SYSEXPUNGE.</span></div>
<div class="line"><a name="l03173"></a><span class="lineno"> 3173</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03174"></a><span class="lineno"> 3174</span>&#160;        <span class="keywordflow">if</span> (!fExclusive) {</div>
<div class="line"><a name="l03175"></a><span class="lineno"> 3175</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#aa1082b32678ff0e6f4d076c83458e1ca">fsWakeMask</a> = fsWakeMask | (<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>)QS_SENDMESSAGE;</div>
<div class="line"><a name="l03176"></a><span class="lineno"> 3176</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03177"></a><span class="lineno"> 3177</span>&#160;            pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#aa1082b32678ff0e6f4d076c83458e1ca">fsWakeMask</a> = fsWakeMask;</div>
<div class="line"><a name="l03178"></a><span class="lineno"> 3178</span>&#160;        }</div>
<div class="line"><a name="l03179"></a><span class="lineno"> 3179</span>&#160; </div>
<div class="line"><a name="l03180"></a><span class="lineno"> 3180</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03181"></a><span class="lineno"> 3181</span>&#160;<span class="comment">         * If we have timed out then return our error to the caller.</span></div>
<div class="line"><a name="l03182"></a><span class="lineno"> 3182</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03183"></a><span class="lineno"> 3183</span>&#160;        <span class="keywordflow">if</span> (status == STATUS_TIMEOUT) {</div>
<div class="line"><a name="l03184"></a><span class="lineno"> 3184</span>&#160;            <a class="code" href="a00371.html#adbdd8355d15a97b6f3a9e4766e6a2cc1">RIPERR1</a>(ERROR_TIMEOUT, <a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;SleepThread: The timeout has expired %lX&quot;</span>, Timeout);</div>
<div class="line"><a name="l03185"></a><span class="lineno"> 3185</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l03186"></a><span class="lineno"> 3186</span>&#160;        }</div>
<div class="line"><a name="l03187"></a><span class="lineno"> 3187</span>&#160; </div>
<div class="line"><a name="l03188"></a><span class="lineno"> 3188</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03189"></a><span class="lineno"> 3189</span>&#160;<span class="comment">         * Because we do a non-alertable wait, we know that a status</span></div>
<div class="line"><a name="l03190"></a><span class="lineno"> 3190</span>&#160;<span class="comment">         * of STATUS_USER_APC means that the thread was terminated.</span></div>
<div class="line"><a name="l03191"></a><span class="lineno"> 3191</span>&#160;<span class="comment">         * If we have terminated, get back to user mode.</span></div>
<div class="line"><a name="l03192"></a><span class="lineno"> 3192</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03193"></a><span class="lineno"> 3193</span>&#160;        <span class="keywordflow">if</span> (status == STATUS_USER_APC) {</div>
<div class="line"><a name="l03194"></a><span class="lineno"> 3194</span>&#160;            <a class="code" href="a00899.html#ab15c206d3faba2643713e9bcaa9f987b">ClientDeliverUserApc</a>();</div>
<div class="line"><a name="l03195"></a><span class="lineno"> 3195</span>&#160;            <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l03196"></a><span class="lineno"> 3196</span>&#160;        }</div>
<div class="line"><a name="l03197"></a><span class="lineno"> 3197</span>&#160; </div>
<div class="line"><a name="l03198"></a><span class="lineno"> 3198</span>&#160;        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(status == STATUS_SUCCESS);</div>
<div class="line"><a name="l03199"></a><span class="lineno"> 3199</span>&#160; </div>
<div class="line"><a name="l03200"></a><span class="lineno"> 3200</span>&#160;        KeClearEvent(pti-&gt;<a class="code" href="a02889.html#a64da47920250096684c62e566c661139">pEventQueueServer</a>);</div>
<div class="line"><a name="l03201"></a><span class="lineno"> 3201</span>&#160; </div>
<div class="line"><a name="l03202"></a><span class="lineno"> 3202</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03203"></a><span class="lineno"> 3203</span>&#160;<span class="comment">         * Check to see if any input came inbetween when we</span></div>
<div class="line"><a name="l03204"></a><span class="lineno"> 3204</span>&#160;<span class="comment">         * last checked and the NtClearEvent() call.</span></div>
<div class="line"><a name="l03205"></a><span class="lineno"> 3205</span>&#160;<span class="comment">         *</span></div>
<div class="line"><a name="l03206"></a><span class="lineno"> 3206</span>&#160;<span class="comment">         * We call NtWaitForSingleObject() rather than</span></div>
<div class="line"><a name="l03207"></a><span class="lineno"> 3207</span>&#160;<span class="comment">         * WaitForSingleObject() so we can set fAlertable</span></div>
<div class="line"><a name="l03208"></a><span class="lineno"> 3208</span>&#160;<span class="comment">         * to TRUE and thus allow timer APCs to be processed.</span></div>
<div class="line"><a name="l03209"></a><span class="lineno"> 3209</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03210"></a><span class="lineno"> 3210</span>&#160;        <span class="keywordflow">if</span> (!(pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> &amp; pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#aa1082b32678ff0e6f4d076c83458e1ca">fsWakeMask</a>)) {</div>
<div class="line"><a name="l03211"></a><span class="lineno"> 3211</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03212"></a><span class="lineno"> 3212</span>&#160;<span class="comment">             * This app is going idle. Clear the spin count check to see</span></div>
<div class="line"><a name="l03213"></a><span class="lineno"> 3213</span>&#160;<span class="comment">             * if we need to make this process foreground again.</span></div>
<div class="line"><a name="l03214"></a><span class="lineno"> 3214</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03215"></a><span class="lineno"> 3215</span>&#160;            <span class="keywordflow">if</span> (fInputIdle) {</div>
<div class="line"><a name="l03216"></a><span class="lineno"> 3216</span>&#160;                <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SPINNING) {</div>
<div class="line"><a name="l03217"></a><span class="lineno"> 3217</span>&#160;                    <a class="code" href="a00824.html#acbf7182e6530b750eed27ef83e03c85f">CheckProcessForeground</a>(pti);</div>
<div class="line"><a name="l03218"></a><span class="lineno"> 3218</span>&#160;                }</div>
<div class="line"><a name="l03219"></a><span class="lineno"> 3219</span>&#160;                pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a79413d59e46650132a5add64bfd87791">cSpins</a> = 0;</div>
<div class="line"><a name="l03220"></a><span class="lineno"> 3220</span>&#160;            }</div>
<div class="line"><a name="l03221"></a><span class="lineno"> 3221</span>&#160; </div>
<div class="line"><a name="l03222"></a><span class="lineno"> 3222</span>&#160; </div>
<div class="line"><a name="l03223"></a><span class="lineno"> 3223</span>&#160;            <span class="keywordflow">if</span> (!(pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT))  {</div>
<div class="line"><a name="l03224"></a><span class="lineno"> 3224</span>&#160;                <span class="keywordflow">if</span> (fInputIdle &amp;&amp; pti == <a class="code" href="a03257.html#a72d6c69b0eefb30311d982761970b971">gptiForeground</a> &amp;&amp;</div>
<div class="line"><a name="l03225"></a><span class="lineno"> 3225</span>&#160;                        IsHooked(pti, WHF_FOREGROUNDIDLE)) {</div>
<div class="line"><a name="l03226"></a><span class="lineno"> 3226</span>&#160;                    <a class="code" href="a00701.html#a4a596c02b66f7f049c18711b882e0b89">xxxCallHook</a>(HC_ACTION, 0, 0, WH_FOREGROUNDIDLE);</div>
<div class="line"><a name="l03227"></a><span class="lineno"> 3227</span>&#160;                }</div>
<div class="line"><a name="l03228"></a><span class="lineno"> 3228</span>&#160; </div>
<div class="line"><a name="l03229"></a><span class="lineno"> 3229</span>&#160;                CheckForClientDeath();</div>
<div class="line"><a name="l03230"></a><span class="lineno"> 3230</span>&#160; </div>
<div class="line"><a name="l03231"></a><span class="lineno"> 3231</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03232"></a><span class="lineno"> 3232</span>&#160;<span class="comment">                 * Set the input idle event to wake up any threads waiting</span></div>
<div class="line"><a name="l03233"></a><span class="lineno"> 3233</span>&#160;<span class="comment">                 * for this thread to go into idle state.</span></div>
<div class="line"><a name="l03234"></a><span class="lineno"> 3234</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03235"></a><span class="lineno"> 3235</span>&#160;                <span class="keywordflow">if</span> (fInputIdle)</div>
<div class="line"><a name="l03236"></a><span class="lineno"> 3236</span>&#160;                    <a class="code" href="a03290.html#adc158fd691fd8f38a443ca9a299b1632">WakeInputIdle</a>(pti);</div>
<div class="line"><a name="l03237"></a><span class="lineno"> 3237</span>&#160; </div>
<div class="line"><a name="l03238"></a><span class="lineno"> 3238</span>&#160;                <a class="code" href="a00881.html#ae11878514dabd4ba1a2c58dd2bcf2d4d">xxxSleepTask</a>(fInputIdle, NULL);</div>
<div class="line"><a name="l03239"></a><span class="lineno"> 3239</span>&#160; </div>
<div class="line"><a name="l03240"></a><span class="lineno"> 3240</span>&#160;                <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l03241"></a><span class="lineno"> 3241</span>&#160;                status = KeWaitForSingleObject(pti-&gt;<a class="code" href="a02889.html#a64da47920250096684c62e566c661139">pEventQueueServer</a>,</div>
<div class="line"><a name="l03242"></a><span class="lineno"> 3242</span>&#160;                        WrUserRequest, UserMode, FALSE, pli);</div>
<div class="line"><a name="l03243"></a><span class="lineno"> 3243</span>&#160;                CheckForClientDeath();</div>
<div class="line"><a name="l03244"></a><span class="lineno"> 3244</span>&#160;                <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l03245"></a><span class="lineno"> 3245</span>&#160; </div>
<div class="line"><a name="l03246"></a><span class="lineno"> 3246</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03247"></a><span class="lineno"> 3247</span>&#160;<span class="comment">                 * Reset the input idle event to block and threads waiting</span></div>
<div class="line"><a name="l03248"></a><span class="lineno"> 3248</span>&#160;<span class="comment">                 * for this thread to go into idle state.</span></div>
<div class="line"><a name="l03249"></a><span class="lineno"> 3249</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03250"></a><span class="lineno"> 3250</span>&#160;                <a class="code" href="a03290.html#a51ccaa0d03e99d3be71c4ac54a262154">SleepInputIdle</a>(pti);</div>
<div class="line"><a name="l03251"></a><span class="lineno"> 3251</span>&#160; </div>
<div class="line"><a name="l03252"></a><span class="lineno"> 3252</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03253"></a><span class="lineno"> 3253</span>&#160;<span class="comment">                 *  pti is 16bit!</span></div>
<div class="line"><a name="l03254"></a><span class="lineno"> 3254</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03255"></a><span class="lineno"> 3255</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03256"></a><span class="lineno"> 3256</span>&#160;                <span class="keywordflow">if</span> (fInputIdle)</div>
<div class="line"><a name="l03257"></a><span class="lineno"> 3257</span>&#160;                    <a class="code" href="a03290.html#adc158fd691fd8f38a443ca9a299b1632">WakeInputIdle</a>(pti);</div>
<div class="line"><a name="l03258"></a><span class="lineno"> 3258</span>&#160; </div>
<div class="line"><a name="l03259"></a><span class="lineno"> 3259</span>&#160;                <a class="code" href="a00881.html#ae11878514dabd4ba1a2c58dd2bcf2d4d">xxxSleepTask</a>(fInputIdle, NULL);</div>
<div class="line"><a name="l03260"></a><span class="lineno"> 3260</span>&#160;            }</div>
<div class="line"><a name="l03261"></a><span class="lineno"> 3261</span>&#160;        }</div>
<div class="line"><a name="l03262"></a><span class="lineno"> 3262</span>&#160;    }</div>
<div class="line"><a name="l03263"></a><span class="lineno"> 3263</span>&#160;}</div>
<div class="line"><a name="l03264"></a><span class="lineno"> 3264</span>&#160; </div>
<div class="line"><a name="l03265"></a><span class="lineno"> 3265</span>&#160; </div>
<div class="line"><a name="l03266"></a><span class="lineno"> 3266</span>&#160; </div>
<div class="line"><a name="l03276"></a><span class="lineno"><a class="line" href="a00899.html#a7a7fb081b27165c43974d89be67bbad8"> 3276</a></span>&#160;VOID <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(</div>
<div class="line"><a name="l03277"></a><span class="lineno"> 3277</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l03278"></a><span class="lineno"> 3278</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> wWakeBit)</div>
<div class="line"><a name="l03279"></a><span class="lineno"> 3279</span>&#160;{</div>
<div class="line"><a name="l03280"></a><span class="lineno"> 3280</span>&#160;    CheckCritIn();</div>
<div class="line"><a name="l03281"></a><span class="lineno"> 3281</span>&#160; </div>
<div class="line"><a name="l03282"></a><span class="lineno"> 3282</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03283"></a><span class="lineno"> 3283</span>&#160;<span class="comment">     * TEMPORARY check for NULL pti introduced 7/27/95 - ianja</span></div>
<div class="line"><a name="l03284"></a><span class="lineno"> 3284</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03285"></a><span class="lineno"> 3285</span>&#160;    <span class="keywordflow">if</span> (pti == NULL) {</div>
<div class="line"><a name="l03286"></a><span class="lineno"> 3286</span>&#160;        <a class="code" href="a00371.html#a31aafffb49dfe98bdc749c9b35c90162">RIPMSG1</a>(<a class="code" href="a00371.html#afa5f32de88404289ec03cd2c0e61e94f">RIP_ERROR</a>, <span class="stringliteral">&quot;SetWakeBit(NULL, %lx)\n&quot;</span>, wWakeBit);</div>
<div class="line"><a name="l03287"></a><span class="lineno"> 3287</span>&#160;        <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l03288"></a><span class="lineno"> 3288</span>&#160;    }</div>
<div class="line"><a name="l03289"></a><span class="lineno"> 3289</span>&#160; </div>
<div class="line"><a name="l03290"></a><span class="lineno"> 3290</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03291"></a><span class="lineno"> 3291</span>&#160;<span class="comment">     * Win3.1 changes ptiKeyboard and ptiMouse accordingly if we&#39;re setting</span></div>
<div class="line"><a name="l03292"></a><span class="lineno"> 3292</span>&#160;<span class="comment">     * those bits.</span></div>
<div class="line"><a name="l03293"></a><span class="lineno"> 3293</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03294"></a><span class="lineno"> 3294</span>&#160;    <span class="keywordflow">if</span> (wWakeBit &amp; QS_MOUSE)</div>
<div class="line"><a name="l03295"></a><span class="lineno"> 3295</span>&#160;        pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#ab38e745019cf5314eea3e78229d367c3">ptiMouse</a> = pti;</div>
<div class="line"><a name="l03296"></a><span class="lineno"> 3296</span>&#160; </div>
<div class="line"><a name="l03297"></a><span class="lineno"> 3297</span>&#160;    <span class="keywordflow">if</span> (wWakeBit &amp; QS_KEY)</div>
<div class="line"><a name="l03298"></a><span class="lineno"> 3298</span>&#160;        pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">ptiKeyboard</a> = pti;</div>
<div class="line"><a name="l03299"></a><span class="lineno"> 3299</span>&#160; </div>
<div class="line"><a name="l03300"></a><span class="lineno"> 3300</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03301"></a><span class="lineno"> 3301</span>&#160;<span class="comment">     * OR in these bits - these bits represent what input this app has</span></div>
<div class="line"><a name="l03302"></a><span class="lineno"> 3302</span>&#160;<span class="comment">     * (fsWakeBits), or what input has arrived since that last look</span></div>
<div class="line"><a name="l03303"></a><span class="lineno"> 3303</span>&#160;<span class="comment">     * (fsChangeBits).</span></div>
<div class="line"><a name="l03304"></a><span class="lineno"> 3304</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03305"></a><span class="lineno"> 3305</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> |= wWakeBit;</div>
<div class="line"><a name="l03306"></a><span class="lineno"> 3306</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> |= wWakeBit;</div>
<div class="line"><a name="l03307"></a><span class="lineno"> 3307</span>&#160; </div>
<div class="line"><a name="l03308"></a><span class="lineno"> 3308</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03309"></a><span class="lineno"> 3309</span>&#160;<span class="comment">     * Before waking, do screen saver check to see if it should</span></div>
<div class="line"><a name="l03310"></a><span class="lineno"> 3310</span>&#160;<span class="comment">     * go away.</span></div>
<div class="line"><a name="l03311"></a><span class="lineno"> 3311</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03312"></a><span class="lineno"> 3312</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SCREENSAVER)</div>
<div class="line"><a name="l03313"></a><span class="lineno"> 3313</span>&#160;        <a class="code" href="a00824.html#a85b93c8ee73cb5dc4eb0e7b3221a454a">ScreenSaverCheck</a>(pti);</div>
<div class="line"><a name="l03314"></a><span class="lineno"> 3314</span>&#160; </div>
<div class="line"><a name="l03315"></a><span class="lineno"> 3315</span>&#160;    <span class="keywordflow">if</span> (wWakeBit &amp; pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#aa1082b32678ff0e6f4d076c83458e1ca">fsWakeMask</a>) {</div>
<div class="line"><a name="l03316"></a><span class="lineno"> 3316</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03317"></a><span class="lineno"> 3317</span>&#160;<span class="comment">         * Wake the Thread</span></div>
<div class="line"><a name="l03318"></a><span class="lineno"> 3318</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03319"></a><span class="lineno"> 3319</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT) {</div>
<div class="line"><a name="l03320"></a><span class="lineno"> 3320</span>&#160;            pti-&gt;<a class="code" href="a02889.html#af8fb3a0f2a65257b83edd457a19dca57">ptdb</a>-&gt;<a class="code" href="a02881.html#a6f032dae4131c13bd5080db077f4e158">nEvents</a>++;</div>
<div class="line"><a name="l03321"></a><span class="lineno"> 3321</span>&#160;            <a class="code" href="a00020.html#ad760da1dd81d9e84dee607d18edfde39">gpsi</a>-&gt;<a class="code" href="a02513.html#a6f032dae4131c13bd5080db077f4e158">nEvents</a>++;</div>
<div class="line"><a name="l03322"></a><span class="lineno"> 3322</span>&#160;            <a class="code" href="a00881.html#a4265fddd1e842410a284d2f4376940f5">WakeWowTask</a>(pti);</div>
<div class="line"><a name="l03323"></a><span class="lineno"> 3323</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03324"></a><span class="lineno"> 3324</span>&#160;            KeSetEvent(pti-&gt;<a class="code" href="a02889.html#a64da47920250096684c62e566c661139">pEventQueueServer</a>, 2, FALSE);</div>
<div class="line"><a name="l03325"></a><span class="lineno"> 3325</span>&#160;        }</div>
<div class="line"><a name="l03326"></a><span class="lineno"> 3326</span>&#160;    }</div>
<div class="line"><a name="l03327"></a><span class="lineno"> 3327</span>&#160;}</div>
<div class="line"><a name="l03328"></a><span class="lineno"> 3328</span>&#160; </div>
<div class="line"><a name="l03329"></a><span class="lineno"> 3329</span>&#160; </div>
<div class="line"><a name="l03339"></a><span class="lineno"><a class="line" href="a00899.html#a99a80316b838769c13ce192f9f0b792f"> 3339</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#a700c756867e191fed7d258edd7e3e536">TransferWakeBit</a>(</div>
<div class="line"><a name="l03340"></a><span class="lineno"> 3340</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l03341"></a><span class="lineno"> 3341</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> message)</div>
<div class="line"><a name="l03342"></a><span class="lineno"> 3342</span>&#160;{</div>
<div class="line"><a name="l03343"></a><span class="lineno"> 3343</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiT;</div>
<div class="line"><a name="l03344"></a><span class="lineno"> 3344</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> fsMask;</div>
<div class="line"><a name="l03345"></a><span class="lineno"> 3345</span>&#160; </div>
<div class="line"><a name="l03346"></a><span class="lineno"> 3346</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03347"></a><span class="lineno"> 3347</span>&#160;<span class="comment">     * Calculate the mask from the message range. Only interested</span></div>
<div class="line"><a name="l03348"></a><span class="lineno"> 3348</span>&#160;<span class="comment">     * in hardware input here: mouse and keys.</span></div>
<div class="line"><a name="l03349"></a><span class="lineno"> 3349</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03350"></a><span class="lineno"> 3350</span>&#160;    fsMask = <a class="code" href="a00365.html#a71c025f23da9f633f32d79fa661dac06">CalcWakeMask</a>(message, message) &amp; (QS_MOUSE | QS_KEY);</div>
<div class="line"><a name="l03351"></a><span class="lineno"> 3351</span>&#160; </div>
<div class="line"><a name="l03352"></a><span class="lineno"> 3352</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03353"></a><span class="lineno"> 3353</span>&#160;<span class="comment">     * If it is set in this thread&#39;s wakebits, nothing to do.</span></div>
<div class="line"><a name="l03354"></a><span class="lineno"> 3354</span>&#160;<span class="comment">     * Otherwise transfer them from the owner to this thread.</span></div>
<div class="line"><a name="l03355"></a><span class="lineno"> 3355</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03356"></a><span class="lineno"> 3356</span>&#160;    <span class="keywordflow">if</span> (!(pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp; fsMask)) {</div>
<div class="line"><a name="l03357"></a><span class="lineno"> 3357</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03358"></a><span class="lineno"> 3358</span>&#160;<span class="comment">         * Either mouse or key is set (not both). Remove this bit</span></div>
<div class="line"><a name="l03359"></a><span class="lineno"> 3359</span>&#160;<span class="comment">         * from the thread that currently owns it, and change mouse /</span></div>
<div class="line"><a name="l03360"></a><span class="lineno"> 3360</span>&#160;<span class="comment">         * key ownership to this thread.</span></div>
<div class="line"><a name="l03361"></a><span class="lineno"> 3361</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03362"></a><span class="lineno"> 3362</span>&#160;        <span class="keywordflow">if</span> (fsMask &amp; QS_KEY) {</div>
<div class="line"><a name="l03363"></a><span class="lineno"> 3363</span>&#160;            ptiT = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">ptiKeyboard</a>;</div>
<div class="line"><a name="l03364"></a><span class="lineno"> 3364</span>&#160;            pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">ptiKeyboard</a> = pti;</div>
<div class="line"><a name="l03365"></a><span class="lineno"> 3365</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03366"></a><span class="lineno"> 3366</span>&#160;            ptiT = pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#ab38e745019cf5314eea3e78229d367c3">ptiMouse</a>;</div>
<div class="line"><a name="l03367"></a><span class="lineno"> 3367</span>&#160;            pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#ab38e745019cf5314eea3e78229d367c3">ptiMouse</a> = pti;</div>
<div class="line"><a name="l03368"></a><span class="lineno"> 3368</span>&#160;        }</div>
<div class="line"><a name="l03369"></a><span class="lineno"> 3369</span>&#160;        ptiT-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp;= ~fsMask;</div>
<div class="line"><a name="l03370"></a><span class="lineno"> 3370</span>&#160; </div>
<div class="line"><a name="l03371"></a><span class="lineno"> 3371</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03372"></a><span class="lineno"> 3372</span>&#160;<span class="comment">         * Transfer them to this thread (certainly this may be the</span></div>
<div class="line"><a name="l03373"></a><span class="lineno"> 3373</span>&#160;<span class="comment">         * same thread for win32 threads not sharing queues).</span></div>
<div class="line"><a name="l03374"></a><span class="lineno"> 3374</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03375"></a><span class="lineno"> 3375</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> |= fsMask;</div>
<div class="line"><a name="l03376"></a><span class="lineno"> 3376</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> |= fsMask;</div>
<div class="line"><a name="l03377"></a><span class="lineno"> 3377</span>&#160;    }</div>
<div class="line"><a name="l03378"></a><span class="lineno"> 3378</span>&#160;}</div>
<div class="line"><a name="l03379"></a><span class="lineno"> 3379</span>&#160; </div>
<div class="line"><a name="l03380"></a><span class="lineno"> 3380</span>&#160; </div>
<div class="line"><a name="l03390"></a><span class="lineno"><a class="line" href="a00899.html#ac708496b23f104c90d93744009fc5037"> 3390</a></span>&#160;VOID <a class="code" href="a00824.html#ac708496b23f104c90d93744009fc5037">ClearWakeBit</a>(</div>
<div class="line"><a name="l03391"></a><span class="lineno"> 3391</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti,</div>
<div class="line"><a name="l03392"></a><span class="lineno"> 3392</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> wWakeBit,</div>
<div class="line"><a name="l03393"></a><span class="lineno"> 3393</span>&#160;    BOOL fSysCheck)</div>
<div class="line"><a name="l03394"></a><span class="lineno"> 3394</span>&#160;{</div>
<div class="line"><a name="l03395"></a><span class="lineno"> 3395</span>&#160; </div>
<div class="line"><a name="l03396"></a><span class="lineno"> 3396</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03397"></a><span class="lineno"> 3397</span>&#160;<span class="comment">     * If fSysCheck is TRUE, clear bits only if we are not doing journal</span></div>
<div class="line"><a name="l03398"></a><span class="lineno"> 3398</span>&#160;<span class="comment">     * playback and there are no more messages in the queue. fSysCheck</span></div>
<div class="line"><a name="l03399"></a><span class="lineno"> 3399</span>&#160;<span class="comment">     * is TRUE if clearing because of no more input.  FALSE if just</span></div>
<div class="line"><a name="l03400"></a><span class="lineno"> 3400</span>&#160;<span class="comment">     * transfering input ownership from one thread to another.</span></div>
<div class="line"><a name="l03401"></a><span class="lineno"> 3401</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03402"></a><span class="lineno"> 3402</span>&#160;    <span class="keywordflow">if</span> (fSysCheck) {</div>
<div class="line"><a name="l03403"></a><span class="lineno"> 3403</span>&#160;        <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">pq</a>-&gt;<a class="code" href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">mlInput</a>.<a class="code" href="a02865.html#adcf976c068271034e6e569ce3109eb07">cMsgs</a> != 0 || FJOURNALPLAYBACK())</div>
<div class="line"><a name="l03404"></a><span class="lineno"> 3404</span>&#160;            <span class="keywordflow">return</span>;</div>
<div class="line"><a name="l03405"></a><span class="lineno"> 3405</span>&#160;    }</div>
<div class="line"><a name="l03406"></a><span class="lineno"> 3406</span>&#160; </div>
<div class="line"><a name="l03407"></a><span class="lineno"> 3407</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03408"></a><span class="lineno"> 3408</span>&#160;<span class="comment">     * Only clear the wake bits, not the change bits as well!</span></div>
<div class="line"><a name="l03409"></a><span class="lineno"> 3409</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03410"></a><span class="lineno"> 3410</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">fsWakeBits</a> &amp;= ~wWakeBit;</div>
<div class="line"><a name="l03411"></a><span class="lineno"> 3411</span>&#160;}</div>
<div class="line"><a name="l03412"></a><span class="lineno"> 3412</span>&#160; </div>
<div class="line"><a name="l03413"></a><span class="lineno"> 3413</span>&#160; </div>
<div class="line"><a name="l03414"></a><span class="lineno"> 3414</span>&#160; </div>
<div class="line"><a name="l03415"></a><span class="lineno"> 3415</span>&#160; </div>
<div class="line"><a name="l03425"></a><span class="lineno"><a class="line" href="a00899.html#a3c7fc64935ed9ba8d78f52b94ee1e7d1"> 3425</a></span>&#160;<a class="code" href="a02889.html">PTHREADINFO</a> <a class="code" href="a00824.html#a3a58c2275b35d4e251d1d2801c54b477">PtiFromThreadId</a>(</div>
<div class="line"><a name="l03426"></a><span class="lineno"> 3426</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwThreadId)</div>
<div class="line"><a name="l03427"></a><span class="lineno"> 3427</span>&#160;{</div>
<div class="line"><a name="l03428"></a><span class="lineno"> 3428</span>&#160;    <a class="code" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a> pEThread;</div>
<div class="line"><a name="l03429"></a><span class="lineno"> 3429</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l03430"></a><span class="lineno"> 3430</span>&#160; </div>
<div class="line"><a name="l03431"></a><span class="lineno"> 3431</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(LockThreadByClientId((HANDLE)dwThreadId, &amp;pEThread)))</div>
<div class="line"><a name="l03432"></a><span class="lineno"> 3432</span>&#160;        <span class="keywordflow">return</span> NULL;</div>
<div class="line"><a name="l03433"></a><span class="lineno"> 3433</span>&#160; </div>
<div class="line"><a name="l03434"></a><span class="lineno"> 3434</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03435"></a><span class="lineno"> 3435</span>&#160;<span class="comment">     * If the thread is not terminating, look up the pti.  This is</span></div>
<div class="line"><a name="l03436"></a><span class="lineno"> 3436</span>&#160;<span class="comment">     * needed because the value returned by PtiFromThread() is</span></div>
<div class="line"><a name="l03437"></a><span class="lineno"> 3437</span>&#160;<span class="comment">     * undefined if the thread is terminating.  See PspExitThread in</span></div>
<div class="line"><a name="l03438"></a><span class="lineno"> 3438</span>&#160;<span class="comment">     * ntos\ps\psdelete.c.</span></div>
<div class="line"><a name="l03439"></a><span class="lineno"> 3439</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03440"></a><span class="lineno"> 3440</span>&#160;    <span class="keywordflow">if</span> (!PsIsThreadTerminating(pEThread)) {</div>
<div class="line"><a name="l03441"></a><span class="lineno"> 3441</span>&#160;        pti = PtiFromThread(pEThread);</div>
<div class="line"><a name="l03442"></a><span class="lineno"> 3442</span>&#160;    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l03443"></a><span class="lineno"> 3443</span>&#160;        pti = NULL;</div>
<div class="line"><a name="l03444"></a><span class="lineno"> 3444</span>&#160;    }</div>
<div class="line"><a name="l03445"></a><span class="lineno"> 3445</span>&#160; </div>
<div class="line"><a name="l03446"></a><span class="lineno"> 3446</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03447"></a><span class="lineno"> 3447</span>&#160;<span class="comment">     * Do a sanity check on the pti to make sure it&#39;s really valid.</span></div>
<div class="line"><a name="l03448"></a><span class="lineno"> 3448</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03449"></a><span class="lineno"> 3449</span>&#160;    <span class="keywordflow">if</span> (pti != NULL) {</div>
<div class="line"><a name="l03450"></a><span class="lineno"> 3450</span>&#160;        <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l03451"></a><span class="lineno"> 3451</span>&#160;            <span class="keywordflow">if</span> (pti-&gt;Thread-&gt;Cid.UniqueThread != (HANDLE)dwThreadId) {</div>
<div class="line"><a name="l03452"></a><span class="lineno"> 3452</span>&#160;                pti = NULL;</div>
<div class="line"><a name="l03453"></a><span class="lineno"> 3453</span>&#160;            }</div>
<div class="line"><a name="l03454"></a><span class="lineno"> 3454</span>&#160;        } except (EXCEPTION_EXECUTE_HANDLER) {</div>
<div class="line"><a name="l03455"></a><span class="lineno"> 3455</span>&#160;            pti = NULL;</div>
<div class="line"><a name="l03456"></a><span class="lineno"> 3456</span>&#160;        }</div>
<div class="line"><a name="l03457"></a><span class="lineno"> 3457</span>&#160;    }</div>
<div class="line"><a name="l03458"></a><span class="lineno"> 3458</span>&#160; </div>
<div class="line"><a name="l03459"></a><span class="lineno"> 3459</span>&#160;    UnlockThread(pEThread);</div>
<div class="line"><a name="l03460"></a><span class="lineno"> 3460</span>&#160; </div>
<div class="line"><a name="l03461"></a><span class="lineno"> 3461</span>&#160;    <span class="keywordflow">return</span> pti;</div>
<div class="line"><a name="l03462"></a><span class="lineno"> 3462</span>&#160;}</div>
<div class="line"><a name="l03463"></a><span class="lineno"> 3463</span>&#160; </div>
<div class="line"><a name="l03464"></a><span class="lineno"> 3464</span>&#160; </div>
<div class="line"><a name="l03465"></a><span class="lineno"> 3465</span>&#160; </div>
<div class="line"><a name="l03474"></a><span class="lineno"><a class="line" href="a00899.html#a0b68ef96f49e53adca4ce08c461442d2"> 3474</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#af9d1b276723341720a345902e1f14645">StoreMessage</a>(</div>
<div class="line"><a name="l03475"></a><span class="lineno"> 3475</span>&#160;    LPMSG pmsg,</div>
<div class="line"><a name="l03476"></a><span class="lineno"> 3476</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd,</div>
<div class="line"><a name="l03477"></a><span class="lineno"> 3477</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> message,</div>
<div class="line"><a name="l03478"></a><span class="lineno"> 3478</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> wParam,</div>
<div class="line"><a name="l03479"></a><span class="lineno"> 3479</span>&#160;    LONG lParam,</div>
<div class="line"><a name="l03480"></a><span class="lineno"> 3480</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> time)</div>
<div class="line"><a name="l03481"></a><span class="lineno"> 3481</span>&#160;{</div>
<div class="line"><a name="l03482"></a><span class="lineno"> 3482</span>&#160;    CheckCritIn();</div>
<div class="line"><a name="l03483"></a><span class="lineno"> 3483</span>&#160; </div>
<div class="line"><a name="l03484"></a><span class="lineno"> 3484</span>&#160;    pmsg-&gt;hwnd = HW(pwnd);</div>
<div class="line"><a name="l03485"></a><span class="lineno"> 3485</span>&#160;    pmsg-&gt;message = message;</div>
<div class="line"><a name="l03486"></a><span class="lineno"> 3486</span>&#160;    pmsg-&gt;wParam = wParam;</div>
<div class="line"><a name="l03487"></a><span class="lineno"> 3487</span>&#160;    pmsg-&gt;lParam = lParam;</div>
<div class="line"><a name="l03488"></a><span class="lineno"> 3488</span>&#160;    pmsg-&gt;time = (time != 0 ? time : NtGetTickCount());</div>
<div class="line"><a name="l03489"></a><span class="lineno"> 3489</span>&#160; </div>
<div class="line"><a name="l03490"></a><span class="lineno"> 3490</span>&#160;    pmsg-&gt;pt = ptCursor;</div>
<div class="line"><a name="l03491"></a><span class="lineno"> 3491</span>&#160;}</div>
<div class="line"><a name="l03492"></a><span class="lineno"> 3492</span>&#160; </div>
<div class="line"><a name="l03493"></a><span class="lineno"> 3493</span>&#160; </div>
<div class="line"><a name="l03494"></a><span class="lineno"> 3494</span>&#160; </div>
<div class="line"><a name="l03502"></a><span class="lineno"><a class="line" href="a00899.html#a00a6eeaae5416f852074af275fa79bd8"> 3502</a></span>&#160;<span class="keywordtype">void</span> <a class="code" href="a00824.html#a40077ba7267f3c31f389f3eeac9c4506">StoreQMessage</a>(</div>
<div class="line"><a name="l03503"></a><span class="lineno"> 3503</span>&#160;    <a class="code" href="a02857.html">PQMSG</a> pqmsg,</div>
<div class="line"><a name="l03504"></a><span class="lineno"> 3504</span>&#160;    <a class="code" href="a02581.html">PWND</a> pwnd,</div>
<div class="line"><a name="l03505"></a><span class="lineno"> 3505</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> message,</div>
<div class="line"><a name="l03506"></a><span class="lineno"> 3506</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> wParam,</div>
<div class="line"><a name="l03507"></a><span class="lineno"> 3507</span>&#160;    LONG lParam,</div>
<div class="line"><a name="l03508"></a><span class="lineno"> 3508</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwQEvent,</div>
<div class="line"><a name="l03509"></a><span class="lineno"> 3509</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwExtraInfo)</div>
<div class="line"><a name="l03510"></a><span class="lineno"> 3510</span>&#160;{</div>
<div class="line"><a name="l03511"></a><span class="lineno"> 3511</span>&#160;    CheckCritIn();</div>
<div class="line"><a name="l03512"></a><span class="lineno"> 3512</span>&#160; </div>
<div class="line"><a name="l03513"></a><span class="lineno"> 3513</span>&#160;    pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.hwnd = HW(pwnd);</div>
<div class="line"><a name="l03514"></a><span class="lineno"> 3514</span>&#160;    pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.message = message;</div>
<div class="line"><a name="l03515"></a><span class="lineno"> 3515</span>&#160;    pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.wParam = wParam;</div>
<div class="line"><a name="l03516"></a><span class="lineno"> 3516</span>&#160;    pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.lParam = lParam;</div>
<div class="line"><a name="l03517"></a><span class="lineno"> 3517</span>&#160;    pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.time = NtGetTickCount();</div>
<div class="line"><a name="l03518"></a><span class="lineno"> 3518</span>&#160;    pqmsg-&gt;<a class="code" href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">msg</a>.pt = ptCursor;</div>
<div class="line"><a name="l03519"></a><span class="lineno"> 3519</span>&#160;    pqmsg-&gt;<a class="code" href="a02857.html#ac4e11a54fcd4eb693fc0c04630804f67">dwQEvent</a> = dwQEvent;</div>
<div class="line"><a name="l03520"></a><span class="lineno"> 3520</span>&#160;    pqmsg-&gt;<a class="code" href="a02857.html#acaac4c4abe64b478521a44ad7f1d692b">ExtraInfo</a> = dwExtraInfo;</div>
<div class="line"><a name="l03521"></a><span class="lineno"> 3521</span>&#160;}</div>
<div class="line"><a name="l03522"></a><span class="lineno"> 3522</span>&#160; </div>
<div class="line"><a name="l03523"></a><span class="lineno"> 3523</span>&#160; </div>
<div class="line"><a name="l03524"></a><span class="lineno"> 3524</span>&#160; </div>
<div class="line"><a name="l03534"></a><span class="lineno"><a class="line" href="a00899.html#aba5a4b7317b2d7e62cb91717544c5a69"> 3534</a></span>&#160;BOOL <a class="code" href="a00824.html#a20d4e3ea15f4d047785697f4c14e94c7">InitProcessInfo</a>(</div>
<div class="line"><a name="l03535"></a><span class="lineno"> 3535</span>&#160;    PW32PROCESS pwp)</div>
<div class="line"><a name="l03536"></a><span class="lineno"> 3536</span>&#160;{</div>
<div class="line"><a name="l03537"></a><span class="lineno"> 3537</span>&#160;    <a class="code" href="a02905.html">PPROCESSINFO</a> ppi = (<a class="code" href="a00365.html#ae68d35bd0e63af682f3d29bf9a03a2f4">PPROCESSINFO</a>)pwp;</div>
<div class="line"><a name="l03538"></a><span class="lineno"> 3538</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l03539"></a><span class="lineno"> 3539</span>&#160; </div>
<div class="line"><a name="l03540"></a><span class="lineno"> 3540</span>&#160;    CheckCritIn();</div>
<div class="line"><a name="l03541"></a><span class="lineno"> 3541</span>&#160; </div>
<div class="line"><a name="l03542"></a><span class="lineno"> 3542</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03543"></a><span class="lineno"> 3543</span>&#160;<span class="comment">     * If initialization has already been done, leave.</span></div>
<div class="line"><a name="l03544"></a><span class="lineno"> 3544</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03545"></a><span class="lineno"> 3545</span>&#160;    <span class="keywordflow">if</span> (ppi-&gt;W32PF_Flags &amp; W32PF_PROCESSCONNECTED)</div>
<div class="line"><a name="l03546"></a><span class="lineno"> 3546</span>&#160;        <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l03547"></a><span class="lineno"> 3547</span>&#160;    ppi-&gt;W32PF_Flags |= W32PF_PROCESSCONNECTED;</div>
<div class="line"><a name="l03548"></a><span class="lineno"> 3548</span>&#160; </div>
<div class="line"><a name="l03549"></a><span class="lineno"> 3549</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03550"></a><span class="lineno"> 3550</span>&#160;<span class="comment">     * Mark this app as &quot;starting&quot; - it will be starting until its first</span></div>
<div class="line"><a name="l03551"></a><span class="lineno"> 3551</span>&#160;<span class="comment">     * window activates.</span></div>
<div class="line"><a name="l03552"></a><span class="lineno"> 3552</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03553"></a><span class="lineno"> 3553</span>&#160;    <a class="code" href="a00824.html#a494493f4db0cfc2a67d2e21d05ba4584">xxxSetProcessInitState</a>(pwp-&gt;Process, STARTF_FORCEOFFFEEDBACK);</div>
<div class="line"><a name="l03554"></a><span class="lineno"> 3554</span>&#160;    ppi-&gt;W32PF_Flags |= W32PF_APPSTARTING;</div>
<div class="line"><a name="l03555"></a><span class="lineno"> 3555</span>&#160;    ppi-&gt;<a class="code" href="a02905.html#a2306374fe9d8ff9df10b4a7491946258">ppiNext</a> = <a class="code" href="a03257.html#af01477af415dcb7442680606f63b5e29">gppiStarting</a>;</div>
<div class="line"><a name="l03556"></a><span class="lineno"> 3556</span>&#160;    <a class="code" href="a03257.html#af01477af415dcb7442680606f63b5e29">gppiStarting</a> = ppi;</div>
<div class="line"><a name="l03557"></a><span class="lineno"> 3557</span>&#160; </div>
<div class="line"><a name="l03558"></a><span class="lineno"> 3558</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03559"></a><span class="lineno"> 3559</span>&#160;<span class="comment">     * Allow this process to come to the foreground when it does its</span></div>
<div class="line"><a name="l03560"></a><span class="lineno"> 3560</span>&#160;<span class="comment">     * first activation.</span></div>
<div class="line"><a name="l03561"></a><span class="lineno"> 3561</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03562"></a><span class="lineno"> 3562</span>&#160;    <span class="keywordflow">if</span> (<a class="code" href="a03257.html#acdbf053b054e159961f2ba3d6e577bfc">gfAllowForegroundActivate</a>)</div>
<div class="line"><a name="l03563"></a><span class="lineno"> 3563</span>&#160;        ppi-&gt;W32PF_Flags |= W32PF_ALLOWFOREGROUNDACTIVATE;</div>
<div class="line"><a name="l03564"></a><span class="lineno"> 3564</span>&#160; </div>
<div class="line"><a name="l03565"></a><span class="lineno"> 3565</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03566"></a><span class="lineno"> 3566</span>&#160;<span class="comment">     * Get the logon session id.  This is used to determine which</span></div>
<div class="line"><a name="l03567"></a><span class="lineno"> 3567</span>&#160;<span class="comment">     * windowstation to connect to and to identify attempts to</span></div>
<div class="line"><a name="l03568"></a><span class="lineno"> 3568</span>&#160;<span class="comment">     * call hooks across security contexts.</span></div>
<div class="line"><a name="l03569"></a><span class="lineno"> 3569</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03570"></a><span class="lineno"> 3570</span>&#160;    Status = <a class="code" href="a00680.html#a297222c1c05315b3b86e418aebd79748">GetProcessLuid</a>(NULL, &amp;ppi-&gt;<a class="code" href="a02905.html#af72a4da82fac27fa09d21912668e92cb">luidSession</a>);</div>
<div class="line"><a name="l03571"></a><span class="lineno"> 3571</span>&#160;    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(NT_SUCCESS(Status));</div>
<div class="line"><a name="l03572"></a><span class="lineno"> 3572</span>&#160; </div>
<div class="line"><a name="l03573"></a><span class="lineno"> 3573</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03574"></a><span class="lineno"> 3574</span>&#160;<span class="comment">     * Ensure that we&#39;re in sync with the expunge count</span></div>
<div class="line"><a name="l03575"></a><span class="lineno"> 3575</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03576"></a><span class="lineno"> 3576</span>&#160;    ppi-&gt;<a class="code" href="a02905.html#a8c47e61ad8490b0e1589fce16938e69f">cSysExpunge</a> = <a class="code" href="a03257.html#a0505c3ff32d34e510caf737f5fb72826">gcSysExpunge</a>;</div>
<div class="line"><a name="l03577"></a><span class="lineno"> 3577</span>&#160; </div>
<div class="line"><a name="l03578"></a><span class="lineno"> 3578</span>&#160;    <span class="keywordflow">return</span> TRUE;</div>
<div class="line"><a name="l03579"></a><span class="lineno"> 3579</span>&#160;}</div>
<div class="line"><a name="l03580"></a><span class="lineno"> 3580</span>&#160; </div>
<div class="line"><a name="l03581"></a><span class="lineno"> 3581</span>&#160; </div>
<div class="line"><a name="l03582"></a><span class="lineno"> 3582</span>&#160; </div>
<div class="line"><a name="l03596"></a><span class="lineno"><a class="line" href="a00899.html#adafea64f7133352fbdba7a7db2f3072c"> 3596</a></span>&#160;BOOL <a class="code" href="a00824.html#a6a7fb4f365d4d2e1262f9393629e17be">DestroyProcessInfo</a>(</div>
<div class="line"><a name="l03597"></a><span class="lineno"> 3597</span>&#160;    PW32PROCESS pwp)</div>
<div class="line"><a name="l03598"></a><span class="lineno"> 3598</span>&#160;{</div>
<div class="line"><a name="l03599"></a><span class="lineno"> 3599</span>&#160;    <a class="code" href="a02905.html">PPROCESSINFO</a> ppi = (<a class="code" href="a00365.html#ae68d35bd0e63af682f3d29bf9a03a2f4">PPROCESSINFO</a>)pwp;</div>
<div class="line"><a name="l03600"></a><span class="lineno"> 3600</span>&#160;    <a class="code" href="a02901.html">PDESKTOPVIEW</a> pdv, pdvNext;</div>
<div class="line"><a name="l03601"></a><span class="lineno"> 3601</span>&#160;    BOOL  fHadThreads;</div>
<div class="line"><a name="l03602"></a><span class="lineno"> 3602</span>&#160; </div>
<div class="line"><a name="l03603"></a><span class="lineno"> 3603</span>&#160;    CheckCritIn();</div>
<div class="line"><a name="l03604"></a><span class="lineno"> 3604</span>&#160; </div>
<div class="line"><a name="l03605"></a><span class="lineno"> 3605</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03606"></a><span class="lineno"> 3606</span>&#160;<span class="comment">     * Free up input idle event if it exists - wake everyone waiting on it</span></div>
<div class="line"><a name="l03607"></a><span class="lineno"> 3607</span>&#160;<span class="comment">     * first.  This object will get created sometimes even for non-windows</span></div>
<div class="line"><a name="l03608"></a><span class="lineno"> 3608</span>&#160;<span class="comment">     * processes (usually for WinExec(), which calls WaitForInputIdle()).</span></div>
<div class="line"><a name="l03609"></a><span class="lineno"> 3609</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03610"></a><span class="lineno"> 3610</span>&#160;    CLOSE_PSEUDO_EVENT(&amp;pwp-&gt;InputIdleEvent);</div>
<div class="line"><a name="l03611"></a><span class="lineno"> 3611</span>&#160; </div>
<div class="line"><a name="l03612"></a><span class="lineno"> 3612</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03613"></a><span class="lineno"> 3613</span>&#160;<span class="comment">     * Check to see if the startglass is on, and if so turn it off and update.</span></div>
<div class="line"><a name="l03614"></a><span class="lineno"> 3614</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03615"></a><span class="lineno"> 3615</span>&#160;    <span class="keywordflow">if</span> (pwp-&gt;W32PF_Flags &amp; W32PF_STARTGLASS) {</div>
<div class="line"><a name="l03616"></a><span class="lineno"> 3616</span>&#160;        pwp-&gt;W32PF_Flags &amp;= ~W32PF_STARTGLASS;</div>
<div class="line"><a name="l03617"></a><span class="lineno"> 3617</span>&#160;        <a class="code" href="a00824.html#a38b809c615e10eca863b213d461e7040">CalcStartCursorHide</a>(NULL, 0);</div>
<div class="line"><a name="l03618"></a><span class="lineno"> 3618</span>&#160;    }</div>
<div class="line"><a name="l03619"></a><span class="lineno"> 3619</span>&#160; </div>
<div class="line"><a name="l03620"></a><span class="lineno"> 3620</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03621"></a><span class="lineno"> 3621</span>&#160;<span class="comment">     * If the process never called Win32k, we&#39;re done.</span></div>
<div class="line"><a name="l03622"></a><span class="lineno"> 3622</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03623"></a><span class="lineno"> 3623</span>&#160;    <span class="keywordflow">if</span> (!(pwp-&gt;W32PF_Flags &amp; W32PF_PROCESSCONNECTED)) {</div>
<div class="line"><a name="l03624"></a><span class="lineno"> 3624</span>&#160;        <span class="keywordflow">return</span> FALSE;</div>
<div class="line"><a name="l03625"></a><span class="lineno"> 3625</span>&#160;    }</div>
<div class="line"><a name="l03626"></a><span class="lineno"> 3626</span>&#160; </div>
<div class="line"><a name="l03627"></a><span class="lineno"> 3627</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03628"></a><span class="lineno"> 3628</span>&#160;<span class="comment">     * Be like WIN95.</span></div>
<div class="line"><a name="l03629"></a><span class="lineno"> 3629</span>&#160;<span class="comment">     * If this is the shell process, then send a LOGON_RESTARTSHELL</span></div>
<div class="line"><a name="l03630"></a><span class="lineno"> 3630</span>&#160;<span class="comment">     *  notification to the winlogon process (only if not logging off)</span></div>
<div class="line"><a name="l03631"></a><span class="lineno"> 3631</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03632"></a><span class="lineno"> 3632</span>&#160;    <span class="keywordflow">if</span> (ppi-&gt;<a class="code" href="a02905.html#a28c079cebbf5a70cee9aea1d83dbd239">rpdeskStartup</a> != 0 &amp;&amp;</div>
<div class="line"><a name="l03633"></a><span class="lineno"> 3633</span>&#160;        ((ULONG)ppi-&gt;Process-&gt;UniqueProcessId == ppi-&gt;<a class="code" href="a02905.html#a28c079cebbf5a70cee9aea1d83dbd239">rpdeskStartup</a>-&gt;<a class="code" href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#af5a2c632fbaf6fbde73f27e29b41e136">idShellProcess</a>)) {</div>
<div class="line"><a name="l03634"></a><span class="lineno"> 3634</span>&#160; </div>
<div class="line"><a name="l03635"></a><span class="lineno"> 3635</span>&#160;        <a class="code" href="a02581.html">PWND</a> spwndLogonNotify = ppi-&gt;<a class="code" href="a02905.html#a1899acfa354d8b3a6a8e69f7a1f781af">rpwinsta</a>-&gt;<a class="code" href="a02809.html#a5734cf57c3cd916ca3c74b17b7c6f39e">spwndLogonNotify</a>;</div>
<div class="line"><a name="l03636"></a><span class="lineno"> 3636</span>&#160; </div>
<div class="line"><a name="l03637"></a><span class="lineno"> 3637</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03638"></a><span class="lineno"> 3638</span>&#160;<span class="comment">         * The shell process will get killed and it&#39;s better to set this</span></div>
<div class="line"><a name="l03639"></a><span class="lineno"> 3639</span>&#160;<span class="comment">         * in the desktop info.</span></div>
<div class="line"><a name="l03640"></a><span class="lineno"> 3640</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03641"></a><span class="lineno"> 3641</span>&#160;        ppi-&gt;<a class="code" href="a02905.html#a28c079cebbf5a70cee9aea1d83dbd239">rpdeskStartup</a>-&gt;<a class="code" href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#af5a2c632fbaf6fbde73f27e29b41e136">idShellProcess</a> = 0;</div>
<div class="line"><a name="l03642"></a><span class="lineno"> 3642</span>&#160; </div>
<div class="line"><a name="l03643"></a><span class="lineno"> 3643</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03644"></a><span class="lineno"> 3644</span>&#160;<span class="comment">         * If we&#39;re not logging off, notify winlogon</span></div>
<div class="line"><a name="l03645"></a><span class="lineno"> 3645</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03646"></a><span class="lineno"> 3646</span>&#160;        <span class="keywordflow">if</span> ((spwndLogonNotify != NULL)</div>
<div class="line"><a name="l03647"></a><span class="lineno"> 3647</span>&#160;                &amp;&amp; !(ppi-&gt;<a class="code" href="a02905.html#a1899acfa354d8b3a6a8e69f7a1f781af">rpwinsta</a>-&gt;<a class="code" href="a02809.html#a4d2f405b1141000eb2af256e0fc8b98b">dwFlags</a> &amp; WSF_OPENLOCK)) {</div>
<div class="line"><a name="l03648"></a><span class="lineno"> 3648</span>&#160; </div>
<div class="line"><a name="l03649"></a><span class="lineno"> 3649</span>&#160;            <a class="code" href="a02889.html">PTHREADINFO</a> pti = GETPTI(spwndLogonNotify);</div>
<div class="line"><a name="l03650"></a><span class="lineno"> 3650</span>&#160;            <a class="code" href="a02857.html">PQMSG</a> pqmsg;</div>
<div class="line"><a name="l03651"></a><span class="lineno"> 3651</span>&#160; </div>
<div class="line"><a name="l03652"></a><span class="lineno"> 3652</span>&#160;            <span class="keywordflow">if</span> ((pqmsg = <a class="code" href="a00824.html#a33338ab17ca4eb073cf36ecc1ae32435">AllocQEntry</a>(&amp;pti-&gt;<a class="code" href="a02889.html#a64e1dadbca00e671a6b925590f57e268">mlPost</a>)) != NULL) {</div>
<div class="line"><a name="l03653"></a><span class="lineno"> 3653</span>&#160;                <a class="code" href="a00824.html#a40077ba7267f3c31f389f3eeac9c4506">StoreQMessage</a>(pqmsg, spwndLogonNotify, WM_LOGONNOTIFY,</div>
<div class="line"><a name="l03654"></a><span class="lineno"> 3654</span>&#160;                        LOGON_RESTARTSHELL, ppi-&gt;Process-&gt;ExitStatus, 0, 0);</div>
<div class="line"><a name="l03655"></a><span class="lineno"> 3655</span>&#160;                <a class="code" href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a>(pti, QS_POSTMESSAGE | QS_ALLPOSTMESSAGE);</div>
<div class="line"><a name="l03656"></a><span class="lineno"> 3656</span>&#160;            }</div>
<div class="line"><a name="l03657"></a><span class="lineno"> 3657</span>&#160;        }</div>
<div class="line"><a name="l03658"></a><span class="lineno"> 3658</span>&#160;    }</div>
<div class="line"><a name="l03659"></a><span class="lineno"> 3659</span>&#160; </div>
<div class="line"><a name="l03660"></a><span class="lineno"> 3660</span>&#160;    <span class="keywordflow">if</span> (ppi-&gt;<a class="code" href="a02905.html#a612848a41faf6b99a0532dc84d375727">cThreads</a>)</div>
<div class="line"><a name="l03661"></a><span class="lineno"> 3661</span>&#160;        <a class="code" href="a00371.html#a31aafffb49dfe98bdc749c9b35c90162">RIPMSG1</a>(<a class="code" href="a00371.html#afa5f32de88404289ec03cd2c0e61e94f">RIP_ERROR</a>, <span class="stringliteral">&quot;Disconnect with %d threads remaining\n&quot;</span>, ppi-&gt;<a class="code" href="a02905.html#a612848a41faf6b99a0532dc84d375727">cThreads</a>);</div>
<div class="line"><a name="l03662"></a><span class="lineno"> 3662</span>&#160; </div>
<div class="line"><a name="l03663"></a><span class="lineno"> 3663</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03664"></a><span class="lineno"> 3664</span>&#160;<span class="comment">     * If the app is still starting, remove it from the startup list</span></div>
<div class="line"><a name="l03665"></a><span class="lineno"> 3665</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03666"></a><span class="lineno"> 3666</span>&#160;    <span class="keywordflow">if</span> (ppi-&gt;W32PF_Flags &amp; W32PF_APPSTARTING) {</div>
<div class="line"><a name="l03667"></a><span class="lineno"> 3667</span>&#160;        <a class="code" href="a02905.html">PPROCESSINFO</a> *pppi;</div>
<div class="line"><a name="l03668"></a><span class="lineno"> 3668</span>&#160; </div>
<div class="line"><a name="l03669"></a><span class="lineno"> 3669</span>&#160;        <span class="keywordflow">for</span> (pppi = &amp;<a class="code" href="a03257.html#af01477af415dcb7442680606f63b5e29">gppiStarting</a>; pppi != NULL; pppi = &amp;(*pppi)-&gt;<a class="code" href="a02905.html#a2306374fe9d8ff9df10b4a7491946258">ppiNext</a>) {</div>
<div class="line"><a name="l03670"></a><span class="lineno"> 3670</span>&#160;            <span class="keywordflow">if</span> (*pppi == ppi) {</div>
<div class="line"><a name="l03671"></a><span class="lineno"> 3671</span>&#160;                *pppi = ppi-&gt;<a class="code" href="a02905.html#a2306374fe9d8ff9df10b4a7491946258">ppiNext</a>;</div>
<div class="line"><a name="l03672"></a><span class="lineno"> 3672</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03673"></a><span class="lineno"> 3673</span>&#160;            }</div>
<div class="line"><a name="l03674"></a><span class="lineno"> 3674</span>&#160;        }</div>
<div class="line"><a name="l03675"></a><span class="lineno"> 3675</span>&#160;        ppi-&gt;W32PF_Flags &amp;= ~W32PF_APPSTARTING;</div>
<div class="line"><a name="l03676"></a><span class="lineno"> 3676</span>&#160;    }</div>
<div class="line"><a name="l03677"></a><span class="lineno"> 3677</span>&#160; </div>
<div class="line"><a name="l03678"></a><span class="lineno"> 3678</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03679"></a><span class="lineno"> 3679</span>&#160;<span class="comment">     * If any threads ever connected, there may be DCs, classes,</span></div>
<div class="line"><a name="l03680"></a><span class="lineno"> 3680</span>&#160;<span class="comment">     * cursors, etc. still lying around.  If not threads connected</span></div>
<div class="line"><a name="l03681"></a><span class="lineno"> 3681</span>&#160;<span class="comment">     * (which is the case for console apps), skip all of this cleanup.</span></div>
<div class="line"><a name="l03682"></a><span class="lineno"> 3682</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03683"></a><span class="lineno"> 3683</span>&#160;    fHadThreads = ppi-&gt;W32PF_Flags &amp; W32PF_THREADCONNECTED;</div>
<div class="line"><a name="l03684"></a><span class="lineno"> 3684</span>&#160;    <span class="keywordflow">if</span> (fHadThreads) {</div>
<div class="line"><a name="l03685"></a><span class="lineno"> 3685</span>&#160; </div>
<div class="line"><a name="l03686"></a><span class="lineno"> 3686</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03687"></a><span class="lineno"> 3687</span>&#160;<span class="comment">         * When a process dies we need to make sure any DCE&#39;s it owns</span></div>
<div class="line"><a name="l03688"></a><span class="lineno"> 3688</span>&#160;<span class="comment">         * and have not been deleted are cleanup up.  The clean up</span></div>
<div class="line"><a name="l03689"></a><span class="lineno"> 3689</span>&#160;<span class="comment">         * earlier may have failed if the DC was busy in GDI.</span></div>
<div class="line"><a name="l03690"></a><span class="lineno"> 3690</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03691"></a><span class="lineno"> 3691</span>&#160;        <span class="keywordflow">if</span> (ppi-&gt;W32PF_Flags &amp; W32PF_OWNDCCLEANUP) {</div>
<div class="line"><a name="l03692"></a><span class="lineno"> 3692</span>&#160;            <a class="code" href="a00644.html#a032fb1a6a955b0ec72e0412511d57ddc">DelayedDestroyCacheDC</a>();</div>
<div class="line"><a name="l03693"></a><span class="lineno"> 3693</span>&#160;        }</div>
<div class="line"><a name="l03694"></a><span class="lineno"> 3694</span>&#160; </div>
<div class="line"><a name="l03695"></a><span class="lineno"> 3695</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03696"></a><span class="lineno"> 3696</span>&#160;<span class="comment">         * If we get here and pti is NULL, that means there never were</span></div>
<div class="line"><a name="l03697"></a><span class="lineno"> 3697</span>&#160;<span class="comment">         * any threads with THREADINFOs, or else this process structure</span></div>
<div class="line"><a name="l03698"></a><span class="lineno"> 3698</span>&#160;<span class="comment">         * would be gone already!  If there never where threads with</span></div>
<div class="line"><a name="l03699"></a><span class="lineno"> 3699</span>&#160;<span class="comment">         * THREADINFOs, then we don&#39;t need to delete all these gui</span></div>
<div class="line"><a name="l03700"></a><span class="lineno"> 3700</span>&#160;<span class="comment">         * objects below...  side affect of this is that when</span></div>
<div class="line"><a name="l03701"></a><span class="lineno"> 3701</span>&#160;<span class="comment">         * calling these routines, PtiCurrent() will always work (will</span></div>
<div class="line"><a name="l03702"></a><span class="lineno"> 3702</span>&#160;<span class="comment">         * return != NULL).</span></div>
<div class="line"><a name="l03703"></a><span class="lineno"> 3703</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03704"></a><span class="lineno"> 3704</span>&#160;        <a class="code" href="a00623.html#a6d3b35d9362572d24857c0fa2e5354ad">DestroyProcessesClasses</a>(ppi);</div>
<div class="line"><a name="l03705"></a><span class="lineno"> 3705</span>&#160;<span class="preprocessor">#if DBG</span></div>
<div class="line"><a name="l03706"></a><span class="lineno"> 3706</span>&#160;        {</div>
<div class="line"><a name="l03707"></a><span class="lineno"> 3707</span>&#160;            <a class="code" href="a02553.html">PHE</a> pheT, pheMax;</div>
<div class="line"><a name="l03708"></a><span class="lineno"> 3708</span>&#160;<span class="keyword">extern</span> CONST BYTE <a class="code" href="a00629.html#af323f4c96b1b44349f66293cb7b4dabb">gabObjectCreateFlags</a>[];</div>
<div class="line"><a name="l03709"></a><span class="lineno"> 3709</span>&#160; </div>
<div class="line"><a name="l03710"></a><span class="lineno"> 3710</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l03711"></a><span class="lineno"> 3711</span>&#160;<span class="comment">             * Loop through the table destroying all objects created by the current</span></div>
<div class="line"><a name="l03712"></a><span class="lineno"> 3712</span>&#160;<span class="comment">             * process. All objects will get destroyed in their proper order simply</span></div>
<div class="line"><a name="l03713"></a><span class="lineno"> 3713</span>&#160;<span class="comment">             * because of the object locking.</span></div>
<div class="line"><a name="l03714"></a><span class="lineno"> 3714</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l03715"></a><span class="lineno"> 3715</span>&#160;            pheMax = &amp;<a class="code" href="a00020.html#ac02f0141c423acd033ecdd2a757a3cc1">gSharedInfo</a>.<a class="code" href="a02521.html#aba571224616f70b9a072015bc9873676">aheList</a>[<a class="code" href="a03257.html#ab302ed5096d732e53f944c97b8321ba0">giheLast</a>];</div>
<div class="line"><a name="l03716"></a><span class="lineno"> 3716</span>&#160;            <span class="keywordflow">for</span> (pheT = <a class="code" href="a00020.html#ac02f0141c423acd033ecdd2a757a3cc1">gSharedInfo</a>.<a class="code" href="a02521.html#aba571224616f70b9a072015bc9873676">aheList</a>; pheT &lt;= pheMax; pheT++) {</div>
<div class="line"><a name="l03717"></a><span class="lineno"> 3717</span>&#160; </div>
<div class="line"><a name="l03718"></a><span class="lineno"> 3718</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l03719"></a><span class="lineno"> 3719</span>&#160;<span class="comment">                 * We should have no process objects left for this process.</span></div>
<div class="line"><a name="l03720"></a><span class="lineno"> 3720</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l03721"></a><span class="lineno"> 3721</span>&#160;                <span class="keywordflow">if</span> ((<a class="code" href="a00629.html#af323f4c96b1b44349f66293cb7b4dabb">gabObjectCreateFlags</a>[pheT-&gt;<a class="code" href="a02553.html#ab51f0b363324b2cf09057a4c55d5100f">bType</a>] &amp; OCF_PROCESSOWNED) &amp;&amp;</div>
<div class="line"><a name="l03722"></a><span class="lineno"> 3722</span>&#160;                        (<a class="code" href="a02905.html">PPROCESSINFO</a>)pheT-&gt;<a class="code" href="a02553.html#a9151e22fb7a09159687c55acdeb8be14">pOwner</a> == ppi) {</div>
<div class="line"><a name="l03723"></a><span class="lineno"> 3723</span>&#160;                    <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(FALSE);</div>
<div class="line"><a name="l03724"></a><span class="lineno"> 3724</span>&#160;                }</div>
<div class="line"><a name="l03725"></a><span class="lineno"> 3725</span>&#160;            }</div>
<div class="line"><a name="l03726"></a><span class="lineno"> 3726</span>&#160;        }</div>
<div class="line"><a name="l03727"></a><span class="lineno"> 3727</span>&#160;<span class="preprocessor">#endif</span></div>
<div class="line"><a name="l03728"></a><span class="lineno"> 3728</span>&#160;    }</div>
<div class="line"><a name="l03729"></a><span class="lineno"> 3729</span>&#160; </div>
<div class="line"><a name="l03730"></a><span class="lineno"> 3730</span>&#160;    UnlockWinSta(&amp;ppi-&gt;<a class="code" href="a02905.html#a1899acfa354d8b3a6a8e69f7a1f781af">rpwinsta</a>);</div>
<div class="line"><a name="l03731"></a><span class="lineno"> 3731</span>&#160;    UnlockDesktop(&amp;ppi-&gt;<a class="code" href="a02905.html#a28c079cebbf5a70cee9aea1d83dbd239">rpdeskStartup</a>);</div>
<div class="line"><a name="l03732"></a><span class="lineno"> 3732</span>&#160; </div>
<div class="line"><a name="l03733"></a><span class="lineno"> 3733</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03734"></a><span class="lineno"> 3734</span>&#160;<span class="comment">     * Mark the process as terminated so access checks will work.</span></div>
<div class="line"><a name="l03735"></a><span class="lineno"> 3735</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03736"></a><span class="lineno"> 3736</span>&#160;    ppi-&gt;W32PF_Flags |= W32PF_TERMINATED;</div>
<div class="line"><a name="l03737"></a><span class="lineno"> 3737</span>&#160; </div>
<div class="line"><a name="l03738"></a><span class="lineno"> 3738</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03739"></a><span class="lineno"> 3739</span>&#160;<span class="comment">     * Cleanup wow process info struct, if any</span></div>
<div class="line"><a name="l03740"></a><span class="lineno"> 3740</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03741"></a><span class="lineno"> 3741</span>&#160;    <span class="keywordflow">if</span> (ppi-&gt;<a class="code" href="a02905.html#a23531249739cdcf88f4894d22d409273">pwpi</a>) {</div>
<div class="line"><a name="l03742"></a><span class="lineno"> 3742</span>&#160;        <a class="code" href="a02897.html">PWOWPROCESSINFO</a> pwpi = ppi-&gt;<a class="code" href="a02905.html#a23531249739cdcf88f4894d22d409273">pwpi</a>;</div>
<div class="line"><a name="l03743"></a><span class="lineno"> 3743</span>&#160;        <a class="code" href="a02897.html">PWOWPROCESSINFO</a> *ppwpi;</div>
<div class="line"><a name="l03744"></a><span class="lineno"> 3744</span>&#160; </div>
<div class="line"><a name="l03745"></a><span class="lineno"> 3745</span>&#160;        ObDereferenceObject(pwpi-&gt;<a class="code" href="a02897.html#ada49aaf1057fad79a982d750d995b8c2">pEventWowExec</a>);</div>
<div class="line"><a name="l03746"></a><span class="lineno"> 3746</span>&#160; </div>
<div class="line"><a name="l03747"></a><span class="lineno"> 3747</span>&#160;        <span class="keywordflow">for</span> (ppwpi = &amp;<a class="code" href="a03257.html#a95e7b47e56cc8a6f2644aa5c6d3acc68">gpwpiFirstWow</a>; *ppwpi != NULL; ppwpi = &amp;((*ppwpi)-&gt;pwpiNext)) {</div>
<div class="line"><a name="l03748"></a><span class="lineno"> 3748</span>&#160;            <span class="keywordflow">if</span> (*ppwpi == pwpi) {</div>
<div class="line"><a name="l03749"></a><span class="lineno"> 3749</span>&#160;                *ppwpi = pwpi-&gt;<a class="code" href="a02897.html#a749a96ead00d6a048c45687a621b241e">pwpiNext</a>;</div>
<div class="line"><a name="l03750"></a><span class="lineno"> 3750</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03751"></a><span class="lineno"> 3751</span>&#160;            }</div>
<div class="line"><a name="l03752"></a><span class="lineno"> 3752</span>&#160;        }</div>
<div class="line"><a name="l03753"></a><span class="lineno"> 3753</span>&#160; </div>
<div class="line"><a name="l03754"></a><span class="lineno"> 3754</span>&#160;        UserFreePool(pwpi);</div>
<div class="line"><a name="l03755"></a><span class="lineno"> 3755</span>&#160;        ppi-&gt;<a class="code" href="a02905.html#a23531249739cdcf88f4894d22d409273">pwpi</a> = NULL;</div>
<div class="line"><a name="l03756"></a><span class="lineno"> 3756</span>&#160;    }</div>
<div class="line"><a name="l03757"></a><span class="lineno"> 3757</span>&#160; </div>
<div class="line"><a name="l03758"></a><span class="lineno"> 3758</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03759"></a><span class="lineno"> 3759</span>&#160;<span class="comment">     * Delete desktop hook attribute bitmap</span></div>
<div class="line"><a name="l03760"></a><span class="lineno"> 3760</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03761"></a><span class="lineno"> 3761</span>&#160;    <span class="keywordflow">if</span> (ppi-&gt;<a class="code" href="a02905.html#a4fd2d2e679634ec3858dace0c31526d1">bmDesktopHookFlags</a>.Buffer)</div>
<div class="line"><a name="l03762"></a><span class="lineno"> 3762</span>&#160;        UserFreePool(ppi-&gt;<a class="code" href="a02905.html#a4fd2d2e679634ec3858dace0c31526d1">bmDesktopHookFlags</a>.Buffer);</div>
<div class="line"><a name="l03763"></a><span class="lineno"> 3763</span>&#160; </div>
<div class="line"><a name="l03764"></a><span class="lineno"> 3764</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03765"></a><span class="lineno"> 3765</span>&#160;<span class="comment">     * Delete desktop views.  System will do unmapping.</span></div>
<div class="line"><a name="l03766"></a><span class="lineno"> 3766</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03767"></a><span class="lineno"> 3767</span>&#160;    pdv = ppi-&gt;<a class="code" href="a02905.html#a13681ea80665f84dc0d89cce4e6e1b81">pdvList</a>;</div>
<div class="line"><a name="l03768"></a><span class="lineno"> 3768</span>&#160;    <span class="keywordflow">while</span> (pdv) {</div>
<div class="line"><a name="l03769"></a><span class="lineno"> 3769</span>&#160;        pdvNext = pdv-&gt;<a class="code" href="a02901.html#a0152e70c5e5553e5908f9f08658f95c8">pdvNext</a>;</div>
<div class="line"><a name="l03770"></a><span class="lineno"> 3770</span>&#160;        UserFreePool(pdv);</div>
<div class="line"><a name="l03771"></a><span class="lineno"> 3771</span>&#160;        pdv = pdvNext;</div>
<div class="line"><a name="l03772"></a><span class="lineno"> 3772</span>&#160;    }</div>
<div class="line"><a name="l03773"></a><span class="lineno"> 3773</span>&#160; </div>
<div class="line"><a name="l03774"></a><span class="lineno"> 3774</span>&#160;    <span class="keywordflow">return</span> fHadThreads;</div>
<div class="line"><a name="l03775"></a><span class="lineno"> 3775</span>&#160;}</div>
<div class="line"><a name="l03776"></a><span class="lineno"> 3776</span>&#160; </div>
<div class="line"><a name="l03777"></a><span class="lineno"> 3777</span>&#160; </div>
<div class="line"><a name="l03787"></a><span class="lineno"><a class="line" href="a00899.html#a3093b6701b169a7a3a6e53937efc850d"> 3787</a></span>&#160;HANDLE <a class="code" href="a00824.html#a3093b6701b169a7a3a6e53937efc850d">xxxGetInputEvent</a>(</div>
<div class="line"><a name="l03788"></a><span class="lineno"> 3788</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwWakeMask)</div>
<div class="line"><a name="l03789"></a><span class="lineno"> 3789</span>&#160;{</div>
<div class="line"><a name="l03790"></a><span class="lineno"> 3790</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l03791"></a><span class="lineno"> 3791</span>&#160; </div>
<div class="line"><a name="l03792"></a><span class="lineno"> 3792</span>&#160;    pti = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l03793"></a><span class="lineno"> 3793</span>&#160; </div>
<div class="line"><a name="l03794"></a><span class="lineno"> 3794</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03795"></a><span class="lineno"> 3795</span>&#160;<span class="comment">     * Refresh the client side event handle (in case the TEB was trashed)</span></div>
<div class="line"><a name="l03796"></a><span class="lineno"> 3796</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03797"></a><span class="lineno"> 3797</span>&#160;    pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a3c194fec8e59a3c52d6c3018cff46ae9">hEventQueueClient</a> = pti-&gt;<a class="code" href="a02889.html#a3c194fec8e59a3c52d6c3018cff46ae9">hEventQueueClient</a>;</div>
<div class="line"><a name="l03798"></a><span class="lineno"> 3798</span>&#160; </div>
<div class="line"><a name="l03799"></a><span class="lineno"> 3799</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03800"></a><span class="lineno"> 3800</span>&#160;<span class="comment">     * If the wake mask is already satisfied, return -1 to signify</span></div>
<div class="line"><a name="l03801"></a><span class="lineno"> 3801</span>&#160;<span class="comment">     * there&#39;s no need to wait.</span></div>
<div class="line"><a name="l03802"></a><span class="lineno"> 3802</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03803"></a><span class="lineno"> 3803</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> &amp; (<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>)dwWakeMask) {</div>
<div class="line"><a name="l03804"></a><span class="lineno"> 3804</span>&#160;        <span class="keywordflow">return</span> (HANDLE)-1;</div>
<div class="line"><a name="l03805"></a><span class="lineno"> 3805</span>&#160;    }</div>
<div class="line"><a name="l03806"></a><span class="lineno"> 3806</span>&#160; </div>
<div class="line"><a name="l03807"></a><span class="lineno"> 3807</span>&#160;    KeClearEvent(pti-&gt;<a class="code" href="a02889.html#a64da47920250096684c62e566c661139">pEventQueueServer</a>);</div>
<div class="line"><a name="l03808"></a><span class="lineno"> 3808</span>&#160; </div>
<div class="line"><a name="l03809"></a><span class="lineno"> 3809</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03810"></a><span class="lineno"> 3810</span>&#160;<span class="comment">     * If an idle hook is set, call it.</span></div>
<div class="line"><a name="l03811"></a><span class="lineno"> 3811</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03812"></a><span class="lineno"> 3812</span>&#160;    <span class="keywordflow">if</span> (pti == <a class="code" href="a03257.html#a72d6c69b0eefb30311d982761970b971">gptiForeground</a> &amp;&amp;</div>
<div class="line"><a name="l03813"></a><span class="lineno"> 3813</span>&#160;            IsHooked(pti, WHF_FOREGROUNDIDLE)) {</div>
<div class="line"><a name="l03814"></a><span class="lineno"> 3814</span>&#160;        <a class="code" href="a00701.html#a4a596c02b66f7f049c18711b882e0b89">xxxCallHook</a>(HC_ACTION, 0, 0, WH_FOREGROUNDIDLE);</div>
<div class="line"><a name="l03815"></a><span class="lineno"> 3815</span>&#160;    }</div>
<div class="line"><a name="l03816"></a><span class="lineno"> 3816</span>&#160; </div>
<div class="line"><a name="l03817"></a><span class="lineno"> 3817</span>&#160;    CheckForClientDeath();</div>
<div class="line"><a name="l03818"></a><span class="lineno"> 3818</span>&#160; </div>
<div class="line"><a name="l03819"></a><span class="lineno"> 3819</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03820"></a><span class="lineno"> 3820</span>&#160;<span class="comment">     * What is the criteria for an &quot;idle process&quot;?</span></div>
<div class="line"><a name="l03821"></a><span class="lineno"> 3821</span>&#160;<span class="comment">     * Answer: The first thread that calls WakeInputIdle, or SleepInputIdle or...</span></div>
<div class="line"><a name="l03822"></a><span class="lineno"> 3822</span>&#160;<span class="comment">     * Any thread that calls xxxGetInputEvent with any of the following</span></div>
<div class="line"><a name="l03823"></a><span class="lineno"> 3823</span>&#160;<span class="comment">     * bits set in its wakemask: (sanfords)</span></div>
<div class="line"><a name="l03824"></a><span class="lineno"> 3824</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03825"></a><span class="lineno"> 3825</span>&#160;    <span class="keywordflow">if</span> (dwWakeMask &amp; (QS_POSTMESSAGE | QS_INPUT)) {</div>
<div class="line"><a name="l03826"></a><span class="lineno"> 3826</span>&#160;        pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a78173b879891f55834e4c01a7193e359">ptiMainThread</a> = pti;</div>
<div class="line"><a name="l03827"></a><span class="lineno"> 3827</span>&#160;    }</div>
<div class="line"><a name="l03828"></a><span class="lineno"> 3828</span>&#160; </div>
<div class="line"><a name="l03829"></a><span class="lineno"> 3829</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03830"></a><span class="lineno"> 3830</span>&#160;<span class="comment">     * When we return, this app is going to sleep. Since it is in its</span></div>
<div class="line"><a name="l03831"></a><span class="lineno"> 3831</span>&#160;<span class="comment">     * idle mode when it goes to sleep, wake any apps waiting for this</span></div>
<div class="line"><a name="l03832"></a><span class="lineno"> 3832</span>&#160;<span class="comment">     * app to go idle.</span></div>
<div class="line"><a name="l03833"></a><span class="lineno"> 3833</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03834"></a><span class="lineno"> 3834</span>&#160;    <a class="code" href="a03290.html#adc158fd691fd8f38a443ca9a299b1632">WakeInputIdle</a>(pti);</div>
<div class="line"><a name="l03835"></a><span class="lineno"> 3835</span>&#160; </div>
<div class="line"><a name="l03836"></a><span class="lineno"> 3836</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03837"></a><span class="lineno"> 3837</span>&#160;<span class="comment">     * Setup the wake mask for this thread. Wait for QS_EVENT or the app won&#39;t</span></div>
<div class="line"><a name="l03838"></a><span class="lineno"> 3838</span>&#160;<span class="comment">     * get event messages like deactivate.</span></div>
<div class="line"><a name="l03839"></a><span class="lineno"> 3839</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03840"></a><span class="lineno"> 3840</span>&#160;    pti-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#aa1082b32678ff0e6f4d076c83458e1ca">fsWakeMask</a> = (<a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a>)dwWakeMask | QS_EVENT;</div>
<div class="line"><a name="l03841"></a><span class="lineno"> 3841</span>&#160; </div>
<div class="line"><a name="l03842"></a><span class="lineno"> 3842</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03843"></a><span class="lineno"> 3843</span>&#160;<span class="comment">     * This app is going idle. Clear the spin count check to see</span></div>
<div class="line"><a name="l03844"></a><span class="lineno"> 3844</span>&#160;<span class="comment">     * if we need to make this process foreground again.</span></div>
<div class="line"><a name="l03845"></a><span class="lineno"> 3845</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03846"></a><span class="lineno"> 3846</span>&#160;    pti-&gt;<a class="code" href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">pClientInfo</a>-&gt;<a class="code" href="a02477.html#a79413d59e46650132a5add64bfd87791">cSpins</a> = 0;</div>
<div class="line"><a name="l03847"></a><span class="lineno"> 3847</span>&#160;    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_SPINNING) {</div>
<div class="line"><a name="l03848"></a><span class="lineno"> 3848</span>&#160;        <a class="code" href="a00824.html#acbf7182e6530b750eed27ef83e03c85f">CheckProcessForeground</a>(pti);</div>
<div class="line"><a name="l03849"></a><span class="lineno"> 3849</span>&#160;    }</div>
<div class="line"><a name="l03850"></a><span class="lineno"> 3850</span>&#160; </div>
<div class="line"><a name="l03851"></a><span class="lineno"> 3851</span>&#160;    <span class="keywordflow">return</span> pti-&gt;<a class="code" href="a02889.html#a3c194fec8e59a3c52d6c3018cff46ae9">hEventQueueClient</a>;</div>
<div class="line"><a name="l03852"></a><span class="lineno"> 3852</span>&#160;}</div>
<div class="line"><a name="l03853"></a><span class="lineno"> 3853</span>&#160; </div>
<div class="line"><a name="l03854"></a><span class="lineno"> 3854</span>&#160; </div>
<div class="line"><a name="l03863"></a><span class="lineno"><a class="line" href="a00899.html#a64cd90ffb9f46c279af3c106dc2be4d9"> 3863</a></span>&#160;<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> <a class="code" href="a00824.html#a64cd90ffb9f46c279af3c106dc2be4d9">xxxWaitForInputIdle</a>(</div>
<div class="line"><a name="l03864"></a><span class="lineno"> 3864</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> idProcess,</div>
<div class="line"><a name="l03865"></a><span class="lineno"> 3865</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwMilliseconds,</div>
<div class="line"><a name="l03866"></a><span class="lineno"> 3866</span>&#160;    BOOL fSharedWow)</div>
<div class="line"><a name="l03867"></a><span class="lineno"> 3867</span>&#160;{</div>
<div class="line"><a name="l03868"></a><span class="lineno"> 3868</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiCurrent;</div>
<div class="line"><a name="l03869"></a><span class="lineno"> 3869</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l03870"></a><span class="lineno"> 3870</span>&#160;    PEPROCESS Process;</div>
<div class="line"><a name="l03871"></a><span class="lineno"> 3871</span>&#160;    PW32PROCESS W32Process;</div>
<div class="line"><a name="l03872"></a><span class="lineno"> 3872</span>&#160;    <a class="code" href="a02905.html">PPROCESSINFO</a> ppi;</div>
<div class="line"><a name="l03873"></a><span class="lineno"> 3873</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwResult;</div>
<div class="line"><a name="l03874"></a><span class="lineno"> 3874</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l03875"></a><span class="lineno"> 3875</span>&#160;    <a class="code" href="a01881.html">TL</a> tlProcess;</div>
<div class="line"><a name="l03876"></a><span class="lineno"> 3876</span>&#160; </div>
<div class="line"><a name="l03877"></a><span class="lineno"> 3877</span>&#160;    ptiCurrent = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l03878"></a><span class="lineno"> 3878</span>&#160; </div>
<div class="line"><a name="l03879"></a><span class="lineno"> 3879</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03880"></a><span class="lineno"> 3880</span>&#160;<span class="comment">     * If fSharedWow is set, the client passed in a fake process</span></div>
<div class="line"><a name="l03881"></a><span class="lineno"> 3881</span>&#160;<span class="comment">     * handle which CreateProcess returns for Win16 apps started</span></div>
<div class="line"><a name="l03882"></a><span class="lineno"> 3882</span>&#160;<span class="comment">     * in the shared WOW VDM.</span></div>
<div class="line"><a name="l03883"></a><span class="lineno"> 3883</span>&#160;<span class="comment">     *</span></div>
<div class="line"><a name="l03884"></a><span class="lineno"> 3884</span>&#160;<span class="comment">     * CreateProcess returns a real process handle when you start</span></div>
<div class="line"><a name="l03885"></a><span class="lineno"> 3885</span>&#160;<span class="comment">     * a Win16 app in a separate WOW VDM.</span></div>
<div class="line"><a name="l03886"></a><span class="lineno"> 3886</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03887"></a><span class="lineno"> 3887</span>&#160; </div>
<div class="line"><a name="l03888"></a><span class="lineno"> 3888</span>&#160;    <span class="keywordflow">if</span> (fSharedWow) {  <span class="comment">// Waiting for a WOW task to go idle.</span></div>
<div class="line"><a name="l03889"></a><span class="lineno"> 3889</span>&#160;        <a class="code" href="a02877.html">PWOWTHREADINFO</a> pwti;</div>
<div class="line"><a name="l03890"></a><span class="lineno"> 3890</span>&#160; </div>
<div class="line"><a name="l03891"></a><span class="lineno"> 3891</span>&#160; </div>
<div class="line"><a name="l03892"></a><span class="lineno"> 3892</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03893"></a><span class="lineno"> 3893</span>&#160;<span class="comment">         * Look for a matching thread in the WOW thread info list.</span></div>
<div class="line"><a name="l03894"></a><span class="lineno"> 3894</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03895"></a><span class="lineno"> 3895</span>&#160;        <span class="keywordflow">for</span> (pwti = <a class="code" href="a03257.html#a7a841563d95fb37851ffe2fd252b4384">gpwtiFirst</a>; pwti != NULL; pwti = pwti-&gt;<a class="code" href="a02877.html#acdfce03ff716b350b5b599cfd8717b3a">pwtiNext</a>) {</div>
<div class="line"><a name="l03896"></a><span class="lineno"> 3896</span>&#160;            <span class="keywordflow">if</span> (pwti-&gt;<a class="code" href="a02877.html#ad05024704e7271fbf8b5f26ccb1770fa">idParentProcess</a> == (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)ptiCurrent-&gt;Thread-&gt;Cid.UniqueProcess &amp;&amp;</div>
<div class="line"><a name="l03897"></a><span class="lineno"> 3897</span>&#160;                pwti-&gt;<a class="code" href="a02877.html#a6484bfbbd54183683e5c1547f9836377">idWaitObject</a> == idProcess) {</div>
<div class="line"><a name="l03898"></a><span class="lineno"> 3898</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l03899"></a><span class="lineno"> 3899</span>&#160;            }</div>
<div class="line"><a name="l03900"></a><span class="lineno"> 3900</span>&#160;        }</div>
<div class="line"><a name="l03901"></a><span class="lineno"> 3901</span>&#160; </div>
<div class="line"><a name="l03902"></a><span class="lineno"> 3902</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03903"></a><span class="lineno"> 3903</span>&#160;<span class="comment">         * If we couldn&#39;t find the right thread, bail out.</span></div>
<div class="line"><a name="l03904"></a><span class="lineno"> 3904</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03905"></a><span class="lineno"> 3905</span>&#160;        <span class="keywordflow">if</span> (pwti == NULL) {</div>
<div class="line"><a name="l03906"></a><span class="lineno"> 3906</span>&#160;            <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;WaitForInputIdle couldn&#39;t find 16-bit task\n&quot;</span>);</div>
<div class="line"><a name="l03907"></a><span class="lineno"> 3907</span>&#160;            <span class="keywordflow">return</span> (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)-1;</div>
<div class="line"><a name="l03908"></a><span class="lineno"> 3908</span>&#160;        }</div>
<div class="line"><a name="l03909"></a><span class="lineno"> 3909</span>&#160; </div>
<div class="line"><a name="l03910"></a><span class="lineno"> 3910</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l03911"></a><span class="lineno"> 3911</span>&#160;<span class="comment">         * Now wait for it to go idle and return.</span></div>
<div class="line"><a name="l03912"></a><span class="lineno"> 3912</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l03913"></a><span class="lineno"> 3913</span>&#160;        dwResult = <a class="code" href="a00824.html#a4aa3b726408152e69f9fd19088883ef4">WaitOnPseudoEvent</a>(&amp;pwti-&gt;<a class="code" href="a02877.html#afb9b6a62420feb835630dae9263ba014">pIdleEvent</a>, dwMilliseconds);</div>
<div class="line"><a name="l03914"></a><span class="lineno"> 3914</span>&#160;        <span class="keywordflow">if</span> (dwResult == STATUS_ABANDONED) {</div>
<div class="line"><a name="l03915"></a><span class="lineno"> 3915</span>&#160;            dwResult = <a class="code" href="a00824.html#a042c33a03ceecdea69466cb1d0e916e7">xxxPollAndWaitForSingleObject</a>(pwti-&gt;<a class="code" href="a02877.html#afb9b6a62420feb835630dae9263ba014">pIdleEvent</a>,</div>
<div class="line"><a name="l03916"></a><span class="lineno"> 3916</span>&#160;                                                     NULL,</div>
<div class="line"><a name="l03917"></a><span class="lineno"> 3917</span>&#160;                                                     dwMilliseconds);</div>
<div class="line"><a name="l03918"></a><span class="lineno"> 3918</span>&#160;        }</div>
<div class="line"><a name="l03919"></a><span class="lineno"> 3919</span>&#160;        <span class="keywordflow">return</span> dwResult;</div>
<div class="line"><a name="l03920"></a><span class="lineno"> 3920</span>&#160; </div>
<div class="line"><a name="l03921"></a><span class="lineno"> 3921</span>&#160;    }</div>
<div class="line"><a name="l03922"></a><span class="lineno"> 3922</span>&#160; </div>
<div class="line"><a name="l03923"></a><span class="lineno"> 3923</span>&#160; </div>
<div class="line"><a name="l03924"></a><span class="lineno"> 3924</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03925"></a><span class="lineno"> 3925</span>&#160;<span class="comment">     * If here, then it is not the shared WOW process</span></div>
<div class="line"><a name="l03926"></a><span class="lineno"> 3926</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03927"></a><span class="lineno"> 3927</span>&#160; </div>
<div class="line"><a name="l03928"></a><span class="lineno"> 3928</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03929"></a><span class="lineno"> 3929</span>&#160;<span class="comment">     * Don&#39;t wait for the system process.</span></div>
<div class="line"><a name="l03930"></a><span class="lineno"> 3930</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03931"></a><span class="lineno"> 3931</span>&#160;    <span class="keywordflow">if</span> (ptiCurrent-&gt;Thread-&gt;ThreadsProcess == <a class="code" href="a03257.html#a5bcbaef1c421c1998d7ea053444e3fc2">gpepSystem</a>)</div>
<div class="line"><a name="l03932"></a><span class="lineno"> 3932</span>&#160;        <span class="keywordflow">return</span> (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)-1;</div>
<div class="line"><a name="l03933"></a><span class="lineno"> 3933</span>&#160; </div>
<div class="line"><a name="l03934"></a><span class="lineno"> 3934</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03935"></a><span class="lineno"> 3935</span>&#160;<span class="comment">     * If the app is waiting for itself to go idle, error.</span></div>
<div class="line"><a name="l03936"></a><span class="lineno"> 3936</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03937"></a><span class="lineno"> 3937</span>&#160;    <span class="keywordflow">if</span> (ptiCurrent-&gt;Thread-&gt;Cid.UniqueProcess == (HANDLE)idProcess &amp;&amp;</div>
<div class="line"><a name="l03938"></a><span class="lineno"> 3938</span>&#160;            ptiCurrent == ptiCurrent-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a78173b879891f55834e4c01a7193e359">ptiMainThread</a>) {</div>
<div class="line"><a name="l03939"></a><span class="lineno"> 3939</span>&#160;        <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;WaitForInputIdle waiting on self\n&quot;</span>);</div>
<div class="line"><a name="l03940"></a><span class="lineno"> 3940</span>&#160;        <span class="keywordflow">return</span> (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)-1;</div>
<div class="line"><a name="l03941"></a><span class="lineno"> 3941</span>&#160;    }</div>
<div class="line"><a name="l03942"></a><span class="lineno"> 3942</span>&#160; </div>
<div class="line"><a name="l03943"></a><span class="lineno"> 3943</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03944"></a><span class="lineno"> 3944</span>&#160;<span class="comment">     * Now find the ppi structure for this process.</span></div>
<div class="line"><a name="l03945"></a><span class="lineno"> 3945</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03946"></a><span class="lineno"> 3946</span>&#160;    <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l03947"></a><span class="lineno"> 3947</span>&#160;    Status = LockProcessByClientId((HANDLE)idProcess, &amp;Process);</div>
<div class="line"><a name="l03948"></a><span class="lineno"> 3948</span>&#160;    <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l03949"></a><span class="lineno"> 3949</span>&#160; </div>
<div class="line"><a name="l03950"></a><span class="lineno"> 3950</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l03951"></a><span class="lineno"> 3951</span>&#160;        <span class="keywordflow">return</span> (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)-1;</div>
<div class="line"><a name="l03952"></a><span class="lineno"> 3952</span>&#160; </div>
<div class="line"><a name="l03953"></a><span class="lineno"> 3953</span>&#160;    <span class="keywordflow">if</span> (Process-&gt;ExitProcessCalled) {</div>
<div class="line"><a name="l03954"></a><span class="lineno"> 3954</span>&#160;        UnlockProcess(Process);</div>
<div class="line"><a name="l03955"></a><span class="lineno"> 3955</span>&#160;        <span class="keywordflow">return</span> (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)-1;</div>
<div class="line"><a name="l03956"></a><span class="lineno"> 3956</span>&#160;    }</div>
<div class="line"><a name="l03957"></a><span class="lineno"> 3957</span>&#160; </div>
<div class="line"><a name="l03958"></a><span class="lineno"> 3958</span>&#160;    W32Process = (PW32PROCESS)Process-&gt;Win32Process;</div>
<div class="line"><a name="l03959"></a><span class="lineno"> 3959</span>&#160; </div>
<div class="line"><a name="l03960"></a><span class="lineno"> 3960</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03961"></a><span class="lineno"> 3961</span>&#160;<span class="comment">     * Couldn&#39;t find that process info structure....  return error.</span></div>
<div class="line"><a name="l03962"></a><span class="lineno"> 3962</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03963"></a><span class="lineno"> 3963</span>&#160;    if (W32Process == NULL) {</div>
<div class="line"><a name="l03964"></a><span class="lineno"> 3964</span>&#160;        <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;WaitForInputIdle process not GUI process\n&quot;</span>);</div>
<div class="line"><a name="l03965"></a><span class="lineno"> 3965</span>&#160;        UnlockProcess(Process);</div>
<div class="line"><a name="l03966"></a><span class="lineno"> 3966</span>&#160;        <span class="keywordflow">return</span> (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)-1;</div>
<div class="line"><a name="l03967"></a><span class="lineno"> 3967</span>&#160;    }</div>
<div class="line"><a name="l03968"></a><span class="lineno"> 3968</span>&#160; </div>
<div class="line"><a name="l03969"></a><span class="lineno"> 3969</span>&#160; </div>
<div class="line"><a name="l03970"></a><span class="lineno"> 3970</span>&#160;    ppi = (<a class="code" href="a00365.html#ae68d35bd0e63af682f3d29bf9a03a2f4">PPROCESSINFO</a>)W32Process;</div>
<div class="line"><a name="l03971"></a><span class="lineno"> 3971</span>&#160; </div>
<div class="line"><a name="l03972"></a><span class="lineno"> 3972</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03973"></a><span class="lineno"> 3973</span>&#160;<span class="comment">     * If this is a console application, don&#39;t wait on it.</span></div>
<div class="line"><a name="l03974"></a><span class="lineno"> 3974</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03975"></a><span class="lineno"> 3975</span>&#160;    <span class="keywordflow">if</span> (W32Process-&gt;W32PF_Flags &amp; W32PF_CONSOLEAPPLICATION) {</div>
<div class="line"><a name="l03976"></a><span class="lineno"> 3976</span>&#160;        <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>, <span class="stringliteral">&quot;WaitForInputIdle process is console process\n&quot;</span>);</div>
<div class="line"><a name="l03977"></a><span class="lineno"> 3977</span>&#160;        UnlockProcess(Process);</div>
<div class="line"><a name="l03978"></a><span class="lineno"> 3978</span>&#160;        <span class="keywordflow">return</span> (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)-1;</div>
<div class="line"><a name="l03979"></a><span class="lineno"> 3979</span>&#160;    }</div>
<div class="line"><a name="l03980"></a><span class="lineno"> 3980</span>&#160; </div>
<div class="line"><a name="l03981"></a><span class="lineno"> 3981</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03982"></a><span class="lineno"> 3982</span>&#160;<span class="comment">     * Wait on this event for the passed in time limit.</span></div>
<div class="line"><a name="l03983"></a><span class="lineno"> 3983</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03984"></a><span class="lineno"> 3984</span>&#160;    CheckForClientDeath();</div>
<div class="line"><a name="l03985"></a><span class="lineno"> 3985</span>&#160; </div>
<div class="line"><a name="l03986"></a><span class="lineno"> 3986</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03987"></a><span class="lineno"> 3987</span>&#160;<span class="comment">     * We have to wait mark the Process as one which others are waiting on</span></div>
<div class="line"><a name="l03988"></a><span class="lineno"> 3988</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03989"></a><span class="lineno"> 3989</span>&#160;    ppi-&gt;W32PF_Flags |= W32PF_WAITFORINPUTIDLE;</div>
<div class="line"><a name="l03990"></a><span class="lineno"> 3990</span>&#160;    <span class="keywordflow">for</span> (pti = ppi-&gt;<a class="code" href="a02905.html#a8dec25df4d4163bb209f9f8c1bc70d45">ptiList</a>; pti != NULL; pti = pti-&gt;<a class="code" href="a02889.html#a318c1d57c31936937fb02314df457e08">ptiSibling</a>) {</div>
<div class="line"><a name="l03991"></a><span class="lineno"> 3991</span>&#160;        pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> |= TIF_WAITFORINPUTIDLE;</div>
<div class="line"><a name="l03992"></a><span class="lineno"> 3992</span>&#160;    }</div>
<div class="line"><a name="l03993"></a><span class="lineno"> 3993</span>&#160; </div>
<div class="line"><a name="l03994"></a><span class="lineno"> 3994</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l03995"></a><span class="lineno"> 3995</span>&#160;<span class="comment">     * Thread lock the process to ensure that it will be dereferenced</span></div>
<div class="line"><a name="l03996"></a><span class="lineno"> 3996</span>&#160;<span class="comment">     * if the thread exits.</span></div>
<div class="line"><a name="l03997"></a><span class="lineno"> 3997</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l03998"></a><span class="lineno"> 3998</span>&#160;    <a class="code" href="a00680.html#a4e651db6bc5a53270aaa9886e26de7c4">ThreadLockObject</a>(ptiCurrent, Process, &amp;tlProcess);</div>
<div class="line"><a name="l03999"></a><span class="lineno"> 3999</span>&#160;    UnlockProcess(Process);</div>
<div class="line"><a name="l04000"></a><span class="lineno"> 4000</span>&#160; </div>
<div class="line"><a name="l04001"></a><span class="lineno"> 4001</span>&#160;    dwResult = <a class="code" href="a00824.html#a4aa3b726408152e69f9fd19088883ef4">WaitOnPseudoEvent</a>(&amp;W32Process-&gt;InputIdleEvent, dwMilliseconds);</div>
<div class="line"><a name="l04002"></a><span class="lineno"> 4002</span>&#160;    <span class="keywordflow">if</span> (dwResult == STATUS_ABANDONED) {</div>
<div class="line"><a name="l04003"></a><span class="lineno"> 4003</span>&#160;        dwResult = <a class="code" href="a00824.html#a042c33a03ceecdea69466cb1d0e916e7">xxxPollAndWaitForSingleObject</a>(W32Process-&gt;InputIdleEvent,</div>
<div class="line"><a name="l04004"></a><span class="lineno"> 4004</span>&#160;                                                 Process,</div>
<div class="line"><a name="l04005"></a><span class="lineno"> 4005</span>&#160;                                                 dwMilliseconds);</div>
<div class="line"><a name="l04006"></a><span class="lineno"> 4006</span>&#160;    }</div>
<div class="line"><a name="l04007"></a><span class="lineno"> 4007</span>&#160; </div>
<div class="line"><a name="l04008"></a><span class="lineno"> 4008</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04009"></a><span class="lineno"> 4009</span>&#160;<span class="comment">     * Check to see if the process died while we were waiting.  Although</span></div>
<div class="line"><a name="l04010"></a><span class="lineno"> 4010</span>&#160;<span class="comment">     * we have the process locked, there is no guarantee that the Win32</span></div>
<div class="line"><a name="l04011"></a><span class="lineno"> 4011</span>&#160;<span class="comment">     * data structures still exist.  Process-&gt;Win32Process is set to</span></div>
<div class="line"><a name="l04012"></a><span class="lineno"> 4012</span>&#160;<span class="comment">     * NULL during process cleanup.</span></div>
<div class="line"><a name="l04013"></a><span class="lineno"> 4013</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04014"></a><span class="lineno"> 4014</span>&#160;    W32Process = (PW32PROCESS)Process-&gt;Win32Process;</div>
<div class="line"><a name="l04015"></a><span class="lineno"> 4015</span>&#160;    if (W32Process != NULL) {</div>
<div class="line"><a name="l04016"></a><span class="lineno"> 4016</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l04017"></a><span class="lineno"> 4017</span>&#160;<span class="comment">         * Clear all thread TIF_WAIT bits from the process.</span></div>
<div class="line"><a name="l04018"></a><span class="lineno"> 4018</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l04019"></a><span class="lineno"> 4019</span>&#160;        ppi = (<a class="code" href="a00365.html#ae68d35bd0e63af682f3d29bf9a03a2f4">PPROCESSINFO</a>)W32Process;</div>
<div class="line"><a name="l04020"></a><span class="lineno"> 4020</span>&#160;        ppi-&gt;W32PF_Flags &amp;= ~W32PF_WAITFORINPUTIDLE;</div>
<div class="line"><a name="l04021"></a><span class="lineno"> 4021</span>&#160;        <span class="keywordflow">for</span> (pti = ppi-&gt;<a class="code" href="a02905.html#a8dec25df4d4163bb209f9f8c1bc70d45">ptiList</a>; pti != NULL; pti = pti-&gt;<a class="code" href="a02889.html#a318c1d57c31936937fb02314df457e08">ptiSibling</a>) {</div>
<div class="line"><a name="l04022"></a><span class="lineno"> 4022</span>&#160;            pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp;= ~TIF_WAITFORINPUTIDLE;</div>
<div class="line"><a name="l04023"></a><span class="lineno"> 4023</span>&#160;        }</div>
<div class="line"><a name="l04024"></a><span class="lineno"> 4024</span>&#160;    }</div>
<div class="line"><a name="l04025"></a><span class="lineno"> 4025</span>&#160; </div>
<div class="line"><a name="l04026"></a><span class="lineno"> 4026</span>&#160;    <a class="code" href="a00680.html#a66df221fdc6a2befeaf8552ff54ab590">ThreadUnlockObject</a>(ptiCurrent);</div>
<div class="line"><a name="l04027"></a><span class="lineno"> 4027</span>&#160; </div>
<div class="line"><a name="l04028"></a><span class="lineno"> 4028</span>&#160;    <span class="keywordflow">return</span> dwResult;</div>
<div class="line"><a name="l04029"></a><span class="lineno"> 4029</span>&#160;}</div>
<div class="line"><a name="l04030"></a><span class="lineno"> 4030</span>&#160; </div>
<div class="line"><a name="l04031"></a><span class="lineno"> 4031</span>&#160; </div>
<div class="line"><a name="l04032"></a><span class="lineno"><a class="line" href="a00824.html#a84f045ca9aa55af0b0979f00d052cca1"> 4032</a></span>&#160;<span class="preprocessor">#define INTERMEDIATE_TIMEOUT    (500)       // 1/2 second</span></div>
<div class="line"><a name="l04033"></a><span class="lineno"> 4033</span>&#160; </div>
<div class="line"><a name="l04034"></a><span class="lineno"> 4034</span>&#160; </div>
<div class="line"><a name="l04047"></a><span class="lineno"> 4047</span>&#160;<span class="comment">// LATER!!! can we get rid of the Polling idea and wait additionally on</span></div>
<div class="line"><a name="l04048"></a><span class="lineno"> 4048</span>&#160;<span class="comment">// LATER!!! the hEventServer and set that when a thread dies</span></div>
<div class="line"><a name="l04049"></a><span class="lineno"> 4049</span>&#160; </div>
<div class="line"><a name="l04050"></a><span class="lineno"><a class="line" href="a00824.html#a042c33a03ceecdea69466cb1d0e916e7"> 4050</a></span>&#160;<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> <a class="code" href="a00824.html#a042c33a03ceecdea69466cb1d0e916e7">xxxPollAndWaitForSingleObject</a>(</div>
<div class="line"><a name="l04051"></a><span class="lineno"> 4051</span>&#160;    PKEVENT pEvent,</div>
<div class="line"><a name="l04052"></a><span class="lineno"> 4052</span>&#160;    PVOID pExecObject,</div>
<div class="line"><a name="l04053"></a><span class="lineno"> 4053</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwMilliseconds)</div>
<div class="line"><a name="l04054"></a><span class="lineno"> 4054</span>&#160;{</div>
<div class="line"><a name="l04055"></a><span class="lineno"> 4055</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwIntermediateMilliseconds;</div>
<div class="line"><a name="l04056"></a><span class="lineno"> 4056</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiCurrent;</div>
<div class="line"><a name="l04057"></a><span class="lineno"> 4057</span>&#160;    <a class="code" href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a> cEvent = 2;</div>
<div class="line"><a name="l04058"></a><span class="lineno"> 4058</span>&#160;    NTSTATUS Status = -1;</div>
<div class="line"><a name="l04059"></a><span class="lineno"> 4059</span>&#160;    LARGE_INTEGER li;</div>
<div class="line"><a name="l04060"></a><span class="lineno"> 4060</span>&#160;    <a class="code" href="a01881.html">TL</a> tlEvent;</div>
<div class="line"><a name="l04061"></a><span class="lineno"> 4061</span>&#160; </div>
<div class="line"><a name="l04062"></a><span class="lineno"> 4062</span>&#160;    ptiCurrent = <a class="code" href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a>();</div>
<div class="line"><a name="l04063"></a><span class="lineno"> 4063</span>&#160; </div>
<div class="line"><a name="l04064"></a><span class="lineno"> 4064</span>&#160;    <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#aa96b1486618d15fb0b653be689092c8e">apEvent</a> == NULL) {</div>
<div class="line"><a name="l04065"></a><span class="lineno"> 4065</span>&#160;        ptiCurrent-&gt;<a class="code" href="a02889.html#aa96b1486618d15fb0b653be689092c8e">apEvent</a> = ExAllocatePoolWithTag(NonPagedPool,</div>
<div class="line"><a name="l04066"></a><span class="lineno"> 4066</span>&#160;                POLL_EVENT_CNT * <span class="keyword">sizeof</span>(PKEVENT), TAG_THREADINFO);</div>
<div class="line"><a name="l04067"></a><span class="lineno"> 4067</span>&#160;        <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#aa96b1486618d15fb0b653be689092c8e">apEvent</a> == NULL)</div>
<div class="line"><a name="l04068"></a><span class="lineno"> 4068</span>&#160;            <span class="keywordflow">return</span> (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)-1;</div>
<div class="line"><a name="l04069"></a><span class="lineno"> 4069</span>&#160;    }</div>
<div class="line"><a name="l04070"></a><span class="lineno"> 4070</span>&#160; </div>
<div class="line"><a name="l04071"></a><span class="lineno"> 4071</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04072"></a><span class="lineno"> 4072</span>&#160;<span class="comment">     * Refcount the event to ensure that it won&#39;t go</span></div>
<div class="line"><a name="l04073"></a><span class="lineno"> 4073</span>&#160;<span class="comment">     * away during the wait.  By using a thread lock, the</span></div>
<div class="line"><a name="l04074"></a><span class="lineno"> 4074</span>&#160;<span class="comment">     * event will be dereferenced if the thread exits</span></div>
<div class="line"><a name="l04075"></a><span class="lineno"> 4075</span>&#160;<span class="comment">     * during a callback.  The process pointer has already been</span></div>
<div class="line"><a name="l04076"></a><span class="lineno"> 4076</span>&#160;<span class="comment">     * locked.</span></div>
<div class="line"><a name="l04077"></a><span class="lineno"> 4077</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04078"></a><span class="lineno"> 4078</span>&#160;    <a class="code" href="a00680.html#a4e651db6bc5a53270aaa9886e26de7c4">ThreadLockObject</a>(ptiCurrent, pEvent, &amp;tlEvent);</div>
<div class="line"><a name="l04079"></a><span class="lineno"> 4079</span>&#160; </div>
<div class="line"><a name="l04080"></a><span class="lineno"> 4080</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04081"></a><span class="lineno"> 4081</span>&#160;<span class="comment">     * If a process was passed in, wait on it too.  No need</span></div>
<div class="line"><a name="l04082"></a><span class="lineno"> 4082</span>&#160;<span class="comment">     * to reference this because the caller has it referenced.</span></div>
<div class="line"><a name="l04083"></a><span class="lineno"> 4083</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04084"></a><span class="lineno"> 4084</span>&#160;    <span class="keywordflow">if</span> (pExecObject) {</div>
<div class="line"><a name="l04085"></a><span class="lineno"> 4085</span>&#160;        cEvent++;</div>
<div class="line"><a name="l04086"></a><span class="lineno"> 4086</span>&#160;    }</div>
<div class="line"><a name="l04087"></a><span class="lineno"> 4087</span>&#160; </div>
<div class="line"><a name="l04088"></a><span class="lineno"> 4088</span>&#160;    KeClearEvent(ptiCurrent-&gt;<a class="code" href="a02889.html#a64da47920250096684c62e566c661139">pEventQueueServer</a>);</div>
<div class="line"><a name="l04089"></a><span class="lineno"> 4089</span>&#160;    ptiCurrent-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#aa1082b32678ff0e6f4d076c83458e1ca">fsWakeMask</a> = QS_SENDMESSAGE;</div>
<div class="line"><a name="l04090"></a><span class="lineno"> 4090</span>&#160; </div>
<div class="line"><a name="l04091"></a><span class="lineno"> 4091</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04092"></a><span class="lineno"> 4092</span>&#160;<span class="comment">     * Wow Tasks MUST be descheduled while in the wait to allow</span></div>
<div class="line"><a name="l04093"></a><span class="lineno"> 4093</span>&#160;<span class="comment">     * other tasks in the same wow scheduler to run.</span></div>
<div class="line"><a name="l04094"></a><span class="lineno"> 4094</span>&#160;<span class="comment">     *</span></div>
<div class="line"><a name="l04095"></a><span class="lineno"> 4095</span>&#160;<span class="comment">     * For example, 16 bit app A calls WaitForInputIdle on 32 bit app B.</span></div>
<div class="line"><a name="l04096"></a><span class="lineno"> 4096</span>&#160;<span class="comment">     * App B starts up and tries to send a message to 16 bit app C. App C</span></div>
<div class="line"><a name="l04097"></a><span class="lineno"> 4097</span>&#160;<span class="comment">     * will never be able to process the message unless app A yields</span></div>
<div class="line"><a name="l04098"></a><span class="lineno"> 4098</span>&#160;<span class="comment">     * control to it, so app B will never go idle.</span></div>
<div class="line"><a name="l04099"></a><span class="lineno"> 4099</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04100"></a><span class="lineno"> 4100</span>&#160; </div>
<div class="line"><a name="l04101"></a><span class="lineno"> 4101</span>&#160;    <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT) {</div>
<div class="line"><a name="l04102"></a><span class="lineno"> 4102</span>&#160;        <a class="code" href="a00881.html#ae11878514dabd4ba1a2c58dd2bcf2d4d">xxxSleepTask</a>(FALSE, HEVENT_REMOVEME);</div>
<div class="line"><a name="l04103"></a><span class="lineno"> 4103</span>&#160;        <span class="comment">// caution: the wow task is no longer scheduled.</span></div>
<div class="line"><a name="l04104"></a><span class="lineno"> 4104</span>&#160;    }</div>
<div class="line"><a name="l04105"></a><span class="lineno"> 4105</span>&#160; </div>
<div class="line"><a name="l04106"></a><span class="lineno"> 4106</span>&#160;    <span class="keywordflow">while</span> (TRUE) {</div>
<div class="line"><a name="l04107"></a><span class="lineno"> 4107</span>&#160;        <span class="keywordflow">if</span> (dwMilliseconds &gt; <a class="code" href="a00824.html#a84f045ca9aa55af0b0979f00d052cca1">INTERMEDIATE_TIMEOUT</a>) {</div>
<div class="line"><a name="l04108"></a><span class="lineno"> 4108</span>&#160;            dwIntermediateMilliseconds = <a class="code" href="a00824.html#a84f045ca9aa55af0b0979f00d052cca1">INTERMEDIATE_TIMEOUT</a>;</div>
<div class="line"><a name="l04109"></a><span class="lineno"> 4109</span>&#160; </div>
<div class="line"><a name="l04110"></a><span class="lineno"> 4110</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04111"></a><span class="lineno"> 4111</span>&#160;<span class="comment">             * If we are not waiting an infinite amount of time then subtract</span></div>
<div class="line"><a name="l04112"></a><span class="lineno"> 4112</span>&#160;<span class="comment">             * the intermediate wait from the total time left to wait.</span></div>
<div class="line"><a name="l04113"></a><span class="lineno"> 4113</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04114"></a><span class="lineno"> 4114</span>&#160;            <span class="keywordflow">if</span> (dwMilliseconds != INFINITE) {</div>
<div class="line"><a name="l04115"></a><span class="lineno"> 4115</span>&#160;                dwMilliseconds -= <a class="code" href="a00824.html#a84f045ca9aa55af0b0979f00d052cca1">INTERMEDIATE_TIMEOUT</a>;</div>
<div class="line"><a name="l04116"></a><span class="lineno"> 4116</span>&#160;            }</div>
<div class="line"><a name="l04117"></a><span class="lineno"> 4117</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04118"></a><span class="lineno"> 4118</span>&#160;            dwIntermediateMilliseconds = dwMilliseconds;</div>
<div class="line"><a name="l04119"></a><span class="lineno"> 4119</span>&#160;            dwMilliseconds = 0;</div>
<div class="line"><a name="l04120"></a><span class="lineno"> 4120</span>&#160;        }</div>
<div class="line"><a name="l04121"></a><span class="lineno"> 4121</span>&#160; </div>
<div class="line"><a name="l04122"></a><span class="lineno"> 4122</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l04123"></a><span class="lineno"> 4123</span>&#160;<span class="comment">         * Convert dwMilliseconds to a relative-time(i.e.  negative) LARGE_INTEGER.</span></div>
<div class="line"><a name="l04124"></a><span class="lineno"> 4124</span>&#160;<span class="comment">         * NT Base calls take time values in 100 nanosecond units.</span></div>
<div class="line"><a name="l04125"></a><span class="lineno"> 4125</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l04126"></a><span class="lineno"> 4126</span>&#160;        <span class="keywordflow">if</span> (dwIntermediateMilliseconds != INFINITE)</div>
<div class="line"><a name="l04127"></a><span class="lineno"> 4127</span>&#160;            li.QuadPart = Int32x32To64(-10000, dwIntermediateMilliseconds);</div>
<div class="line"><a name="l04128"></a><span class="lineno"> 4128</span>&#160; </div>
<div class="line"><a name="l04129"></a><span class="lineno"> 4129</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l04130"></a><span class="lineno"> 4130</span>&#160;<span class="comment">         * Load events into the wait array.  Do this every time</span></div>
<div class="line"><a name="l04131"></a><span class="lineno"> 4131</span>&#160;<span class="comment">         * through the loop in case of recursion.</span></div>
<div class="line"><a name="l04132"></a><span class="lineno"> 4132</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l04133"></a><span class="lineno"> 4133</span>&#160;        ptiCurrent-&gt;<a class="code" href="a02889.html#aa96b1486618d15fb0b653be689092c8e">apEvent</a>[IEV_IDLE] = pEvent;</div>
<div class="line"><a name="l04134"></a><span class="lineno"> 4134</span>&#160;        ptiCurrent-&gt;<a class="code" href="a02889.html#aa96b1486618d15fb0b653be689092c8e">apEvent</a>[IEV_INPUT] = ptiCurrent-&gt;<a class="code" href="a02889.html#a64da47920250096684c62e566c661139">pEventQueueServer</a>;</div>
<div class="line"><a name="l04135"></a><span class="lineno"> 4135</span>&#160;        ptiCurrent-&gt;<a class="code" href="a02889.html#aa96b1486618d15fb0b653be689092c8e">apEvent</a>[IEV_EXEC] = pExecObject;</div>
<div class="line"><a name="l04136"></a><span class="lineno"> 4136</span>&#160; </div>
<div class="line"><a name="l04137"></a><span class="lineno"> 4137</span>&#160;        <a class="code" href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a>();</div>
<div class="line"><a name="l04138"></a><span class="lineno"> 4138</span>&#160; </div>
<div class="line"><a name="l04139"></a><span class="lineno"> 4139</span>&#160;        Status = KeWaitForMultipleObjects(cEvent,</div>
<div class="line"><a name="l04140"></a><span class="lineno"> 4140</span>&#160;                                          &amp;ptiCurrent-&gt;<a class="code" href="a02889.html#aa96b1486618d15fb0b653be689092c8e">apEvent</a>[IEV_IDLE],</div>
<div class="line"><a name="l04141"></a><span class="lineno"> 4141</span>&#160;                                          WaitAny,</div>
<div class="line"><a name="l04142"></a><span class="lineno"> 4142</span>&#160;                                          WrUserRequest,</div>
<div class="line"><a name="l04143"></a><span class="lineno"> 4143</span>&#160;                                          UserMode,</div>
<div class="line"><a name="l04144"></a><span class="lineno"> 4144</span>&#160;                                          FALSE,</div>
<div class="line"><a name="l04145"></a><span class="lineno"> 4145</span>&#160;                                          (dwIntermediateMilliseconds == INFINITE ?</div>
<div class="line"><a name="l04146"></a><span class="lineno"> 4146</span>&#160;                                                  NULL : &amp;li),</div>
<div class="line"><a name="l04147"></a><span class="lineno"> 4147</span>&#160;                                          NULL);</div>
<div class="line"><a name="l04148"></a><span class="lineno"> 4148</span>&#160; </div>
<div class="line"><a name="l04149"></a><span class="lineno"> 4149</span>&#160;        <a class="code" href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a>();</div>
<div class="line"><a name="l04150"></a><span class="lineno"> 4150</span>&#160; </div>
<div class="line"><a name="l04151"></a><span class="lineno"> 4151</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l04152"></a><span class="lineno"> 4152</span>&#160;            Status = -1;</div>
<div class="line"><a name="l04153"></a><span class="lineno"> 4153</span>&#160;        } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04154"></a><span class="lineno"> 4154</span>&#160; </div>
<div class="line"><a name="l04155"></a><span class="lineno"> 4155</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04156"></a><span class="lineno"> 4156</span>&#160;<span class="comment">             * Because we do a non-alertable wait, we know that a status</span></div>
<div class="line"><a name="l04157"></a><span class="lineno"> 4157</span>&#160;<span class="comment">             * of STATUS_USER_APC means that the thread was terminated.</span></div>
<div class="line"><a name="l04158"></a><span class="lineno"> 4158</span>&#160;<span class="comment">             * If we have terminated, get back to user mode</span></div>
<div class="line"><a name="l04159"></a><span class="lineno"> 4159</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04160"></a><span class="lineno"> 4160</span>&#160;            <span class="keywordflow">if</span> (Status == STATUS_USER_APC) {</div>
<div class="line"><a name="l04161"></a><span class="lineno"> 4161</span>&#160;                <a class="code" href="a00899.html#ab15c206d3faba2643713e9bcaa9f987b">ClientDeliverUserApc</a>();</div>
<div class="line"><a name="l04162"></a><span class="lineno"> 4162</span>&#160;                Status = -1;</div>
<div class="line"><a name="l04163"></a><span class="lineno"> 4163</span>&#160;            }</div>
<div class="line"><a name="l04164"></a><span class="lineno"> 4164</span>&#160;        }</div>
<div class="line"><a name="l04165"></a><span class="lineno"> 4165</span>&#160; </div>
<div class="line"><a name="l04166"></a><span class="lineno"> 4166</span>&#160;        <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">pcti</a>-&gt;<a class="code" href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">fsChangeBits</a> &amp; QS_SENDMESSAGE) {</div>
<div class="line"><a name="l04167"></a><span class="lineno"> 4167</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04168"></a><span class="lineno"> 4168</span>&#160;<span class="comment">             *  Wow Tasks MUST wait to be rescheduled in the wow non-premptive</span></div>
<div class="line"><a name="l04169"></a><span class="lineno"> 4169</span>&#160;<span class="comment">             *  scheduler before doing anything which might invoke client code.</span></div>
<div class="line"><a name="l04170"></a><span class="lineno"> 4170</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04171"></a><span class="lineno"> 4171</span>&#160;            <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT) {</div>
<div class="line"><a name="l04172"></a><span class="lineno"> 4172</span>&#160;                <a class="code" href="a00881.html#a16f932bda409a22bfb319067daffc1a1">xxxDirectedYield</a>(DY_OLDYIELD);</div>
<div class="line"><a name="l04173"></a><span class="lineno"> 4173</span>&#160;            }</div>
<div class="line"><a name="l04174"></a><span class="lineno"> 4174</span>&#160; </div>
<div class="line"><a name="l04175"></a><span class="lineno"> 4175</span>&#160;            xxxReceiveMessages(ptiCurrent);</div>
<div class="line"><a name="l04176"></a><span class="lineno"> 4176</span>&#160; </div>
<div class="line"><a name="l04177"></a><span class="lineno"> 4177</span>&#160;            <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT) {</div>
<div class="line"><a name="l04178"></a><span class="lineno"> 4178</span>&#160;                <a class="code" href="a00881.html#ae11878514dabd4ba1a2c58dd2bcf2d4d">xxxSleepTask</a>(FALSE, HEVENT_REMOVEME);</div>
<div class="line"><a name="l04179"></a><span class="lineno"> 4179</span>&#160;                <span class="comment">// caution: the wow task is no longer scheduled.</span></div>
<div class="line"><a name="l04180"></a><span class="lineno"> 4180</span>&#160;            }</div>
<div class="line"><a name="l04181"></a><span class="lineno"> 4181</span>&#160;        }</div>
<div class="line"><a name="l04182"></a><span class="lineno"> 4182</span>&#160; </div>
<div class="line"><a name="l04183"></a><span class="lineno"> 4183</span>&#160;        <span class="comment">/*</span></div>
<div class="line"><a name="l04184"></a><span class="lineno"> 4184</span>&#160;<span class="comment">         * If we returned from the wait for some other reason than a timeout</span></div>
<div class="line"><a name="l04185"></a><span class="lineno"> 4185</span>&#160;<span class="comment">         * or to receive messages we are done.  If it is a timeout we are</span></div>
<div class="line"><a name="l04186"></a><span class="lineno"> 4186</span>&#160;<span class="comment">         * only done waiting if the overall time is zero.</span></div>
<div class="line"><a name="l04187"></a><span class="lineno"> 4187</span>&#160;<span class="comment">         */</span></div>
<div class="line"><a name="l04188"></a><span class="lineno"> 4188</span>&#160;        <span class="keywordflow">if</span> (Status != STATUS_TIMEOUT &amp;&amp; Status != 1)</div>
<div class="line"><a name="l04189"></a><span class="lineno"> 4189</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04190"></a><span class="lineno"> 4190</span>&#160; </div>
<div class="line"><a name="l04191"></a><span class="lineno"> 4191</span>&#160;        <span class="keywordflow">if</span> (dwMilliseconds == 0) {</div>
<div class="line"><a name="l04192"></a><span class="lineno"> 4192</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04193"></a><span class="lineno"> 4193</span>&#160;<span class="comment">             * Fix up the return if the last poll was interupted by a message</span></div>
<div class="line"><a name="l04194"></a><span class="lineno"> 4194</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04195"></a><span class="lineno"> 4195</span>&#160;            <span class="keywordflow">if</span> (Status == 1)</div>
<div class="line"><a name="l04196"></a><span class="lineno"> 4196</span>&#160;                Status = WAIT_TIMEOUT;</div>
<div class="line"><a name="l04197"></a><span class="lineno"> 4197</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04198"></a><span class="lineno"> 4198</span>&#160;        }</div>
<div class="line"><a name="l04199"></a><span class="lineno"> 4199</span>&#160; </div>
<div class="line"><a name="l04200"></a><span class="lineno"> 4200</span>&#160;    }</div>
<div class="line"><a name="l04201"></a><span class="lineno"> 4201</span>&#160; </div>
<div class="line"><a name="l04202"></a><span class="lineno"> 4202</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04203"></a><span class="lineno"> 4203</span>&#160;<span class="comment">     * reschedule the 16 bit app</span></div>
<div class="line"><a name="l04204"></a><span class="lineno"> 4204</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04205"></a><span class="lineno"> 4205</span>&#160;    <span class="keywordflow">if</span> (ptiCurrent-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT) {</div>
<div class="line"><a name="l04206"></a><span class="lineno"> 4206</span>&#160;        <a class="code" href="a00881.html#a16f932bda409a22bfb319067daffc1a1">xxxDirectedYield</a>(DY_OLDYIELD);</div>
<div class="line"><a name="l04207"></a><span class="lineno"> 4207</span>&#160;    }</div>
<div class="line"><a name="l04208"></a><span class="lineno"> 4208</span>&#160; </div>
<div class="line"><a name="l04209"></a><span class="lineno"> 4209</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04210"></a><span class="lineno"> 4210</span>&#160;<span class="comment">     * Unlock the events.</span></div>
<div class="line"><a name="l04211"></a><span class="lineno"> 4211</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04212"></a><span class="lineno"> 4212</span>&#160;    <a class="code" href="a00680.html#a66df221fdc6a2befeaf8552ff54ab590">ThreadUnlockObject</a>(ptiCurrent);     <span class="comment">// tlEvent</span></div>
<div class="line"><a name="l04213"></a><span class="lineno"> 4213</span>&#160; </div>
<div class="line"><a name="l04214"></a><span class="lineno"> 4214</span>&#160;    <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l04215"></a><span class="lineno"> 4215</span>&#160;}</div>
<div class="line"><a name="l04216"></a><span class="lineno"> 4216</span>&#160; </div>
<div class="line"><a name="l04217"></a><span class="lineno"> 4217</span>&#160; </div>
<div class="line"><a name="l04218"></a><span class="lineno"> 4218</span>&#160; </div>
<div class="line"><a name="l04219"></a><span class="lineno"> 4219</span>&#160; </div>
<div class="line"><a name="l04231"></a><span class="lineno"><a class="line" href="a00899.html#a4aa3b726408152e69f9fd19088883ef4"> 4231</a></span>&#160;<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> <a class="code" href="a00824.html#a4aa3b726408152e69f9fd19088883ef4">WaitOnPseudoEvent</a>(</div>
<div class="line"><a name="l04232"></a><span class="lineno"> 4232</span>&#160;    HANDLE *phE,</div>
<div class="line"><a name="l04233"></a><span class="lineno"> 4233</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwMilliseconds)</div>
<div class="line"><a name="l04234"></a><span class="lineno"> 4234</span>&#160;{</div>
<div class="line"><a name="l04235"></a><span class="lineno"> 4235</span>&#160;    HANDLE hEvent;</div>
<div class="line"><a name="l04236"></a><span class="lineno"> 4236</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l04237"></a><span class="lineno"> 4237</span>&#160; </div>
<div class="line"><a name="l04238"></a><span class="lineno"> 4238</span>&#160;    CheckCritIn();</div>
<div class="line"><a name="l04239"></a><span class="lineno"> 4239</span>&#160;    <span class="keywordflow">if</span> (*phE == PSEUDO_EVENT_OFF) {</div>
<div class="line"><a name="l04240"></a><span class="lineno"> 4240</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(ZwCreateEvent(&amp;hEvent, EVENT_ALL_ACCESS, NULL,</div>
<div class="line"><a name="l04241"></a><span class="lineno"> 4241</span>&#160;                NotificationEvent, FALSE))) {</div>
<div class="line"><a name="l04242"></a><span class="lineno"> 4242</span>&#160;            <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(!<span class="stringliteral">&quot;Could not create event on the fly.&quot;</span>);</div>
<div class="line"><a name="l04243"></a><span class="lineno"> 4243</span>&#160;            <span class="keywordflow">if</span> (dwMilliseconds != INFINITE) {</div>
<div class="line"><a name="l04244"></a><span class="lineno"> 4244</span>&#160;                <span class="keywordflow">return</span> STATUS_TIMEOUT;</div>
<div class="line"><a name="l04245"></a><span class="lineno"> 4245</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04246"></a><span class="lineno"> 4246</span>&#160;                <span class="keywordflow">return</span> (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)-1;</div>
<div class="line"><a name="l04247"></a><span class="lineno"> 4247</span>&#160;            }</div>
<div class="line"><a name="l04248"></a><span class="lineno"> 4248</span>&#160;        }</div>
<div class="line"><a name="l04249"></a><span class="lineno"> 4249</span>&#160;        Status = ObReferenceObjectByHandle(hEvent, EVENT_ALL_ACCESS, NULL,</div>
<div class="line"><a name="l04250"></a><span class="lineno"> 4250</span>&#160;                KernelMode, phE, NULL);</div>
<div class="line"><a name="l04251"></a><span class="lineno"> 4251</span>&#160;        ZwClose(hEvent);</div>
<div class="line"><a name="l04252"></a><span class="lineno"> 4252</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l04253"></a><span class="lineno"> 4253</span>&#160;            <span class="keywordflow">return</span> (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)-1;</div>
<div class="line"><a name="l04254"></a><span class="lineno"> 4254</span>&#160;    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (*phE == PSEUDO_EVENT_ON) {</div>
<div class="line"><a name="l04255"></a><span class="lineno"> 4255</span>&#160;        <span class="keywordflow">return</span> STATUS_WAIT_0;</div>
<div class="line"><a name="l04256"></a><span class="lineno"> 4256</span>&#160;    }</div>
<div class="line"><a name="l04257"></a><span class="lineno"> 4257</span>&#160;    <span class="keywordflow">return</span>(STATUS_ABANDONED);</div>
<div class="line"><a name="l04258"></a><span class="lineno"> 4258</span>&#160;}</div>
<div class="line"><a name="l04259"></a><span class="lineno"> 4259</span>&#160; </div>
<div class="line"><a name="l04260"></a><span class="lineno"> 4260</span>&#160; </div>
<div class="line"><a name="l04269"></a><span class="lineno"><a class="line" href="a00899.html#a502bc63b46d63257da536ef1d37a94bd"> 4269</a></span>&#160;NTSTATUS <a class="code" href="a00824.html#a502bc63b46d63257da536ef1d37a94bd">QueryInformationThread</a>(</div>
<div class="line"><a name="l04270"></a><span class="lineno"> 4270</span>&#160;    IN HANDLE hThread,</div>
<div class="line"><a name="l04271"></a><span class="lineno"> 4271</span>&#160;    IN USERTHREADINFOCLASS ThreadInfoClass,</div>
<div class="line"><a name="l04272"></a><span class="lineno"> 4272</span>&#160;    OUT PVOID ThreadInformation,</div>
<div class="line"><a name="l04273"></a><span class="lineno"> 4273</span>&#160;    IN ULONG ThreadInformationLength,</div>
<div class="line"><a name="l04274"></a><span class="lineno"> 4274</span>&#160;    OUT PULONG ReturnLength OPTIONAL)</div>
<div class="line"><a name="l04275"></a><span class="lineno"> 4275</span>&#160;{</div>
<div class="line"><a name="l04276"></a><span class="lineno"> 4276</span>&#160;    PUSERTHREAD_SHUTDOWN_INFORMATION pShutdown;</div>
<div class="line"><a name="l04277"></a><span class="lineno"> 4277</span>&#160;    PUSERTHREAD_WOW_INFORMATION pWow;</div>
<div class="line"><a name="l04278"></a><span class="lineno"> 4278</span>&#160;    ANSI_STRING strAppName;</div>
<div class="line"><a name="l04279"></a><span class="lineno"> 4279</span>&#160;    UNICODE_STRING strAppNameU;</div>
<div class="line"><a name="l04280"></a><span class="lineno"> 4280</span>&#160;    <a class="code" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a> Thread;</div>
<div class="line"><a name="l04281"></a><span class="lineno"> 4281</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l04282"></a><span class="lineno"> 4282</span>&#160;    NTSTATUS Status = STATUS_SUCCESS;</div>
<div class="line"><a name="l04283"></a><span class="lineno"> 4283</span>&#160;    ULONG LocalReturnLength = 0;</div>
<div class="line"><a name="l04284"></a><span class="lineno"> 4284</span>&#160; </div>
<div class="line"><a name="l04285"></a><span class="lineno"> 4285</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04286"></a><span class="lineno"> 4286</span>&#160;<span class="comment">     * Only allow CSRSS to make this call</span></div>
<div class="line"><a name="l04287"></a><span class="lineno"> 4287</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04288"></a><span class="lineno"> 4288</span>&#160;    <span class="keywordflow">if</span> (PsGetCurrentProcess() != <a class="code" href="a03257.html#a3eabb6cc6d3b24f411b7f94f5d6edac6">gpepCSRSS</a>)</div>
<div class="line"><a name="l04289"></a><span class="lineno"> 4289</span>&#160;        <span class="keywordflow">return</span> STATUS_ACCESS_DENIED;</div>
<div class="line"><a name="l04290"></a><span class="lineno"> 4290</span>&#160; </div>
<div class="line"><a name="l04291"></a><span class="lineno"> 4291</span>&#160;    Status = ObReferenceObjectByHandle(hThread,</div>
<div class="line"><a name="l04292"></a><span class="lineno"> 4292</span>&#160;                                        THREAD_QUERY_INFORMATION,</div>
<div class="line"><a name="l04293"></a><span class="lineno"> 4293</span>&#160;                                        NULL,</div>
<div class="line"><a name="l04294"></a><span class="lineno"> 4294</span>&#160;                                        UserMode,</div>
<div class="line"><a name="l04295"></a><span class="lineno"> 4295</span>&#160;                                        &amp;Thread,</div>
<div class="line"><a name="l04296"></a><span class="lineno"> 4296</span>&#160;                                        NULL);</div>
<div class="line"><a name="l04297"></a><span class="lineno"> 4297</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l04298"></a><span class="lineno"> 4298</span>&#160;        <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l04299"></a><span class="lineno"> 4299</span>&#160;    <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l04300"></a><span class="lineno"> 4300</span>&#160;        pti = PtiFromThread(Thread);</div>
<div class="line"><a name="l04301"></a><span class="lineno"> 4301</span>&#160; </div>
<div class="line"><a name="l04302"></a><span class="lineno"> 4302</span>&#160;        <span class="keywordflow">switch</span> (ThreadInfoClass) {</div>
<div class="line"><a name="l04303"></a><span class="lineno"> 4303</span>&#160;        <span class="keywordflow">case</span> UserThreadShutdownInformation:</div>
<div class="line"><a name="l04304"></a><span class="lineno"> 4304</span>&#160;            LocalReturnLength = <span class="keyword">sizeof</span>(USERTHREAD_SHUTDOWN_INFORMATION);</div>
<div class="line"><a name="l04305"></a><span class="lineno"> 4305</span>&#160;            <span class="keywordflow">if</span> (ThreadInformationLength != <span class="keyword">sizeof</span>(USERTHREAD_SHUTDOWN_INFORMATION)) {</div>
<div class="line"><a name="l04306"></a><span class="lineno"> 4306</span>&#160;                Status = STATUS_INFO_LENGTH_MISMATCH;</div>
<div class="line"><a name="l04307"></a><span class="lineno"> 4307</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04308"></a><span class="lineno"> 4308</span>&#160;            }</div>
<div class="line"><a name="l04309"></a><span class="lineno"> 4309</span>&#160;            pShutdown = ThreadInformation;</div>
<div class="line"><a name="l04310"></a><span class="lineno"> 4310</span>&#160;            RtlZeroMemory(pShutdown, <span class="keyword">sizeof</span>(USERTHREAD_SHUTDOWN_INFORMATION));</div>
<div class="line"><a name="l04311"></a><span class="lineno"> 4311</span>&#160; </div>
<div class="line"><a name="l04312"></a><span class="lineno"> 4312</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04313"></a><span class="lineno"> 4313</span>&#160;<span class="comment">             * Return the desktop window handle if the thread</span></div>
<div class="line"><a name="l04314"></a><span class="lineno"> 4314</span>&#160;<span class="comment">             * has a desktop and the desktop is on a visible</span></div>
<div class="line"><a name="l04315"></a><span class="lineno"> 4315</span>&#160;<span class="comment">             * windowstation.</span></div>
<div class="line"><a name="l04316"></a><span class="lineno"> 4316</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04317"></a><span class="lineno"> 4317</span>&#160;            <span class="keywordflow">if</span> (pti != NULL &amp;&amp; pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a> != NULL &amp;&amp;</div>
<div class="line"><a name="l04318"></a><span class="lineno"> 4318</span>&#160;                    !(pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>-&gt;<a class="code" href="a02801.html#aec6cab8a48f05b1fd77850a34109675e">rpwinstaParent</a>-&gt;<a class="code" href="a02809.html#a4d2f405b1141000eb2af256e0fc8b98b">dwFlags</a> &amp; WSF_NOIO))</div>
<div class="line"><a name="l04319"></a><span class="lineno"> 4319</span>&#160;                pShutdown-&gt;hwndDesktop = HW(pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>-&gt;<a class="code" href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">pDeskInfo</a>-&gt;<a class="code" href="a02609.html#a68937d60a6f49b7a8431db62b38ea721">spwnd</a>);</div>
<div class="line"><a name="l04320"></a><span class="lineno"> 4320</span>&#160; </div>
<div class="line"><a name="l04321"></a><span class="lineno"> 4321</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04322"></a><span class="lineno"> 4322</span>&#160;<span class="comment">             * Return shutdown status.  Zero indicates that the thread</span></div>
<div class="line"><a name="l04323"></a><span class="lineno"> 4323</span>&#160;<span class="comment">             * has windows and can be shut down in the normal manner.</span></div>
<div class="line"><a name="l04324"></a><span class="lineno"> 4324</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04325"></a><span class="lineno"> 4325</span>&#160;            <span class="keywordflow">if</span> (Thread-&gt;Cid.UniqueProcess == <a class="code" href="a03257.html#ad4b0bbbb1f1fce28a4e874ae6fb92262">gpidLogon</a>) {</div>
<div class="line"><a name="l04326"></a><span class="lineno"> 4326</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04327"></a><span class="lineno"> 4327</span>&#160;<span class="comment">                 * Do not shutdown the logon process.</span></div>
<div class="line"><a name="l04328"></a><span class="lineno"> 4328</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04329"></a><span class="lineno"> 4329</span>&#160;                pShutdown-&gt;StatusShutdown = SHUTDOWN_KNOWN_PROCESS;</div>
<div class="line"><a name="l04330"></a><span class="lineno"> 4330</span>&#160;            } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pti == NULL || pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a> == NULL) {</div>
<div class="line"><a name="l04331"></a><span class="lineno"> 4331</span>&#160; </div>
<div class="line"><a name="l04332"></a><span class="lineno"> 4332</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04333"></a><span class="lineno"> 4333</span>&#160;<span class="comment">                 * The thread either is not a gui thread or it doesn&#39;t</span></div>
<div class="line"><a name="l04334"></a><span class="lineno"> 4334</span>&#160;<span class="comment">                 * have a desktop.  Make console do the shutdown.</span></div>
<div class="line"><a name="l04335"></a><span class="lineno"> 4335</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04336"></a><span class="lineno"> 4336</span>&#160;                pShutdown-&gt;StatusShutdown = SHUTDOWN_UNKNOWN_PROCESS;</div>
<div class="line"><a name="l04337"></a><span class="lineno"> 4337</span>&#160;            }</div>
<div class="line"><a name="l04338"></a><span class="lineno"> 4338</span>&#160; </div>
<div class="line"><a name="l04339"></a><span class="lineno"> 4339</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04340"></a><span class="lineno"> 4340</span>&#160;<span class="comment">             * Return flags</span></div>
<div class="line"><a name="l04341"></a><span class="lineno"> 4341</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04342"></a><span class="lineno"> 4342</span>&#160;            <span class="keywordflow">if</span> (pti != NULL &amp;&amp; pti-&gt;<a class="code" href="a02889.html#acb32ba9beb876baf218e65f524d10b17">cWindows</a> != 0)</div>
<div class="line"><a name="l04343"></a><span class="lineno"> 4343</span>&#160;                pShutdown-&gt;dwFlags |= USER_THREAD_GUI;</div>
<div class="line"><a name="l04344"></a><span class="lineno"> 4344</span>&#160; </div>
<div class="line"><a name="l04345"></a><span class="lineno"> 4345</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04346"></a><span class="lineno"> 4346</span>&#160;<span class="comment">             * If we return the desktop window handle and the</span></div>
<div class="line"><a name="l04347"></a><span class="lineno"> 4347</span>&#160;<span class="comment">             * app should be shut down, switch to the desktop.</span></div>
<div class="line"><a name="l04348"></a><span class="lineno"> 4348</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04349"></a><span class="lineno"> 4349</span>&#160;            <span class="keywordflow">if</span> ((pShutdown-&gt;dwFlags &amp; USER_THREAD_GUI) &amp;&amp;</div>
<div class="line"><a name="l04350"></a><span class="lineno"> 4350</span>&#160;                    pShutdown-&gt;StatusShutdown == 0) {</div>
<div class="line"><a name="l04351"></a><span class="lineno"> 4351</span>&#160;                <a class="code" href="a00656.html#a0a50756aedb803f4cf70af680806c045">xxxSwitchDesktop</a>(pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>-&gt;<a class="code" href="a02801.html#aec6cab8a48f05b1fd77850a34109675e">rpwinstaParent</a>, pti-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>, FALSE);</div>
<div class="line"><a name="l04352"></a><span class="lineno"> 4352</span>&#160;            }</div>
<div class="line"><a name="l04353"></a><span class="lineno"> 4353</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04354"></a><span class="lineno"> 4354</span>&#160; </div>
<div class="line"><a name="l04355"></a><span class="lineno"> 4355</span>&#160;        <span class="keywordflow">case</span> UserThreadFlags:</div>
<div class="line"><a name="l04356"></a><span class="lineno"> 4356</span>&#160;            LocalReturnLength = <span class="keyword">sizeof</span>(<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>);</div>
<div class="line"><a name="l04357"></a><span class="lineno"> 4357</span>&#160;            <span class="keywordflow">if</span> (pti == NULL)</div>
<div class="line"><a name="l04358"></a><span class="lineno"> 4358</span>&#160;                Status = STATUS_INVALID_HANDLE;</div>
<div class="line"><a name="l04359"></a><span class="lineno"> 4359</span>&#160;            <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ThreadInformationLength != <span class="keyword">sizeof</span>(<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>))</div>
<div class="line"><a name="l04360"></a><span class="lineno"> 4360</span>&#160;                Status = STATUS_INFO_LENGTH_MISMATCH;</div>
<div class="line"><a name="l04361"></a><span class="lineno"> 4361</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l04362"></a><span class="lineno"> 4362</span>&#160;                *(LPDWORD)ThreadInformation = pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a>;</div>
<div class="line"><a name="l04363"></a><span class="lineno"> 4363</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04364"></a><span class="lineno"> 4364</span>&#160; </div>
<div class="line"><a name="l04365"></a><span class="lineno"> 4365</span>&#160;        <span class="keywordflow">case</span> UserThreadTaskName:</div>
<div class="line"><a name="l04366"></a><span class="lineno"> 4366</span>&#160;            if (pti == NULL) {</div>
<div class="line"><a name="l04367"></a><span class="lineno"> 4367</span>&#160;                *(LPWSTR)ThreadInformation = 0;</div>
<div class="line"><a name="l04368"></a><span class="lineno"> 4368</span>&#160;                LocalReturnLength = 0;</div>
<div class="line"><a name="l04369"></a><span class="lineno"> 4369</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04370"></a><span class="lineno"> 4370</span>&#160;            }</div>
<div class="line"><a name="l04371"></a><span class="lineno"> 4371</span>&#160;            <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a> != NULL) {</div>
<div class="line"><a name="l04372"></a><span class="lineno"> 4372</span>&#160;                LocalReturnLength = min(pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a>-&gt;Length + <span class="keyword">sizeof</span>(WCHAR),</div>
<div class="line"><a name="l04373"></a><span class="lineno"> 4373</span>&#160;                        ThreadInformationLength);</div>
<div class="line"><a name="l04374"></a><span class="lineno"> 4374</span>&#160;                RtlCopyMemory(ThreadInformation, pti-&gt;<a class="code" href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">pstrAppName</a>-&gt;Buffer,</div>
<div class="line"><a name="l04375"></a><span class="lineno"> 4375</span>&#160;                        LocalReturnLength);</div>
<div class="line"><a name="l04376"></a><span class="lineno"> 4376</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04377"></a><span class="lineno"> 4377</span>&#160;                RtlInitAnsiString(&amp;strAppName, pti-&gt;Thread-&gt;ThreadsProcess-&gt;ImageFileName);</div>
<div class="line"><a name="l04378"></a><span class="lineno"> 4378</span>&#160;                <span class="keywordflow">if</span> (ThreadInformationLength &lt; <span class="keyword">sizeof</span>(WCHAR))</div>
<div class="line"><a name="l04379"></a><span class="lineno"> 4379</span>&#160;                    LocalReturnLength = (strAppName.Length + 1) * <span class="keyword">sizeof</span>(WCHAR);</div>
<div class="line"><a name="l04380"></a><span class="lineno"> 4380</span>&#160;                <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04381"></a><span class="lineno"> 4381</span>&#160;                    strAppNameU.Buffer = (PWCHAR)ThreadInformation;</div>
<div class="line"><a name="l04382"></a><span class="lineno"> 4382</span>&#160;                    strAppNameU.MaximumLength = (SHORT)ThreadInformationLength -</div>
<div class="line"><a name="l04383"></a><span class="lineno"> 4383</span>&#160;                            <span class="keyword">sizeof</span>(WCHAR);</div>
<div class="line"><a name="l04384"></a><span class="lineno"> 4384</span>&#160;                    Status = RtlAnsiStringToUnicodeString(&amp;strAppNameU, &amp;strAppName,</div>
<div class="line"><a name="l04385"></a><span class="lineno"> 4385</span>&#160;                            FALSE);</div>
<div class="line"><a name="l04386"></a><span class="lineno"> 4386</span>&#160;                    <span class="keywordflow">if</span> (NT_SUCCESS(Status))</div>
<div class="line"><a name="l04387"></a><span class="lineno"> 4387</span>&#160;                        LocalReturnLength = strAppNameU.Length + <span class="keyword">sizeof</span>(WCHAR);</div>
<div class="line"><a name="l04388"></a><span class="lineno"> 4388</span>&#160;                }</div>
<div class="line"><a name="l04389"></a><span class="lineno"> 4389</span>&#160;            }</div>
<div class="line"><a name="l04390"></a><span class="lineno"> 4390</span>&#160;            ((LPWSTR)ThreadInformation)[(LocalReturnLength / <span class="keyword">sizeof</span>(WCHAR)) - 1] = 0;</div>
<div class="line"><a name="l04391"></a><span class="lineno"> 4391</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04392"></a><span class="lineno"> 4392</span>&#160; </div>
<div class="line"><a name="l04393"></a><span class="lineno"> 4393</span>&#160;        <span class="keywordflow">case</span> UserThreadWOWInformation:</div>
<div class="line"><a name="l04394"></a><span class="lineno"> 4394</span>&#160;            LocalReturnLength = <span class="keyword">sizeof</span>(USERTHREAD_WOW_INFORMATION);</div>
<div class="line"><a name="l04395"></a><span class="lineno"> 4395</span>&#160;            <span class="keywordflow">if</span> (ThreadInformationLength != <span class="keyword">sizeof</span>(USERTHREAD_WOW_INFORMATION)) {</div>
<div class="line"><a name="l04396"></a><span class="lineno"> 4396</span>&#160;                Status = STATUS_INFO_LENGTH_MISMATCH;</div>
<div class="line"><a name="l04397"></a><span class="lineno"> 4397</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04398"></a><span class="lineno"> 4398</span>&#160;            }</div>
<div class="line"><a name="l04399"></a><span class="lineno"> 4399</span>&#160;            pWow = ThreadInformation;</div>
<div class="line"><a name="l04400"></a><span class="lineno"> 4400</span>&#160;            RtlZeroMemory(pWow, <span class="keyword">sizeof</span>(USERTHREAD_WOW_INFORMATION));</div>
<div class="line"><a name="l04401"></a><span class="lineno"> 4401</span>&#160; </div>
<div class="line"><a name="l04402"></a><span class="lineno"> 4402</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04403"></a><span class="lineno"> 4403</span>&#160;<span class="comment">             * If the thread is 16-bit, Status = the exit task function</span></div>
<div class="line"><a name="l04404"></a><span class="lineno"> 4404</span>&#160;<span class="comment">             * and task id.</span></div>
<div class="line"><a name="l04405"></a><span class="lineno"> 4405</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04406"></a><span class="lineno"> 4406</span>&#160;            <span class="keywordflow">if</span> (pti &amp;&amp; pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> &amp; TIF_16BIT) {</div>
<div class="line"><a name="l04407"></a><span class="lineno"> 4407</span>&#160;                pWow-&gt;lpfnWowExitTask = (PVOID)pti-&gt;<a class="code" href="a02889.html#a215417492fadc11678c689da2447f02e">ppi</a>-&gt;<a class="code" href="a02905.html#a23531249739cdcf88f4894d22d409273">pwpi</a>-&gt;<a class="code" href="a02897.html#a83e6f4dd67deb5f5db5682a4a565d5a3">lpfnWowExitTask</a>;</div>
<div class="line"><a name="l04408"></a><span class="lineno"> 4408</span>&#160;                if (pti-&gt;<a class="code" href="a02889.html#af8fb3a0f2a65257b83edd457a19dca57">ptdb</a>)</div>
<div class="line"><a name="l04409"></a><span class="lineno"> 4409</span>&#160;                    pWow-&gt;hTaskWow = pti-&gt;<a class="code" href="a02889.html#af8fb3a0f2a65257b83edd457a19dca57">ptdb</a>-&gt;<a class="code" href="a02881.html#aeabb91a1bd6171bbe97ebb98b926ec63">hTaskWow</a>;</div>
<div class="line"><a name="l04410"></a><span class="lineno"> 4410</span>&#160;                <span class="keywordflow">else</span></div>
<div class="line"><a name="l04411"></a><span class="lineno"> 4411</span>&#160;                    pWow-&gt;hTaskWow = 0;</div>
<div class="line"><a name="l04412"></a><span class="lineno"> 4412</span>&#160;            }</div>
<div class="line"><a name="l04413"></a><span class="lineno"> 4413</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04414"></a><span class="lineno"> 4414</span>&#160; </div>
<div class="line"><a name="l04415"></a><span class="lineno"> 4415</span>&#160;        <span class="keywordflow">case</span> UserThreadHungStatus:</div>
<div class="line"><a name="l04416"></a><span class="lineno"> 4416</span>&#160;            LocalReturnLength = <span class="keyword">sizeof</span>(<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>);</div>
<div class="line"><a name="l04417"></a><span class="lineno"> 4417</span>&#160;            <span class="keywordflow">if</span> (ThreadInformationLength &lt; <span class="keyword">sizeof</span>(<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)) {</div>
<div class="line"><a name="l04418"></a><span class="lineno"> 4418</span>&#160;                Status = STATUS_INFO_LENGTH_MISMATCH;</div>
<div class="line"><a name="l04419"></a><span class="lineno"> 4419</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04420"></a><span class="lineno"> 4420</span>&#160;            }</div>
<div class="line"><a name="l04421"></a><span class="lineno"> 4421</span>&#160; </div>
<div class="line"><a name="l04422"></a><span class="lineno"> 4422</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04423"></a><span class="lineno"> 4423</span>&#160;<span class="comment">             * Return hung status.</span></div>
<div class="line"><a name="l04424"></a><span class="lineno"> 4424</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04425"></a><span class="lineno"> 4425</span>&#160;            <span class="keywordflow">if</span> (pti)</div>
<div class="line"><a name="l04426"></a><span class="lineno"> 4426</span>&#160;                *(PDWORD)ThreadInformation =</div>
<div class="line"><a name="l04427"></a><span class="lineno"> 4427</span>&#160;                        (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>) <a class="code" href="a00707.html#a47795b53cdc961798b5310ea5b01456b">FHungApp</a>(pti, (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)*(PDWORD)ThreadInformation);</div>
<div class="line"><a name="l04428"></a><span class="lineno"> 4428</span>&#160;            <span class="keywordflow">else</span></div>
<div class="line"><a name="l04429"></a><span class="lineno"> 4429</span>&#160;                *(PDWORD)ThreadInformation = FALSE;</div>
<div class="line"><a name="l04430"></a><span class="lineno"> 4430</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04431"></a><span class="lineno"> 4431</span>&#160; </div>
<div class="line"><a name="l04432"></a><span class="lineno"> 4432</span>&#160;        <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l04433"></a><span class="lineno"> 4433</span>&#160;            Status = STATUS_INVALID_INFO_CLASS;</div>
<div class="line"><a name="l04434"></a><span class="lineno"> 4434</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04435"></a><span class="lineno"> 4435</span>&#160;        }</div>
<div class="line"><a name="l04436"></a><span class="lineno"> 4436</span>&#160; </div>
<div class="line"><a name="l04437"></a><span class="lineno"> 4437</span>&#160;        <span class="keywordflow">if</span> (ARGUMENT_PRESENT(ReturnLength) ) {</div>
<div class="line"><a name="l04438"></a><span class="lineno"> 4438</span>&#160;            *ReturnLength = LocalReturnLength;</div>
<div class="line"><a name="l04439"></a><span class="lineno"> 4439</span>&#160;            }</div>
<div class="line"><a name="l04440"></a><span class="lineno"> 4440</span>&#160; </div>
<div class="line"><a name="l04441"></a><span class="lineno"> 4441</span>&#160;        UnlockThread(Thread);</div>
<div class="line"><a name="l04442"></a><span class="lineno"> 4442</span>&#160;        }</div>
<div class="line"><a name="l04443"></a><span class="lineno"> 4443</span>&#160;    except (EXCEPTION_EXECUTE_HANDLER) {</div>
<div class="line"><a name="l04444"></a><span class="lineno"> 4444</span>&#160;        UnlockThread(Thread);</div>
<div class="line"><a name="l04445"></a><span class="lineno"> 4445</span>&#160;        Status = GetExceptionCode();</div>
<div class="line"><a name="l04446"></a><span class="lineno"> 4446</span>&#160;        }</div>
<div class="line"><a name="l04447"></a><span class="lineno"> 4447</span>&#160; </div>
<div class="line"><a name="l04448"></a><span class="lineno"> 4448</span>&#160;    <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l04449"></a><span class="lineno"> 4449</span>&#160;}</div>
<div class="line"><a name="l04450"></a><span class="lineno"> 4450</span>&#160; </div>
<div class="line"><a name="l04451"></a><span class="lineno"> 4451</span>&#160; </div>
<div class="line"><a name="l04460"></a><span class="lineno"><a class="line" href="a00899.html#a5fe304d96dc6f187ba69392175042daa"> 4460</a></span>&#160;NTSTATUS <a class="code" href="a00824.html#a5fe304d96dc6f187ba69392175042daa">SetInformationThread</a>(</div>
<div class="line"><a name="l04461"></a><span class="lineno"> 4461</span>&#160;    IN HANDLE hThread,</div>
<div class="line"><a name="l04462"></a><span class="lineno"> 4462</span>&#160;    IN USERTHREADINFOCLASS ThreadInfoClass,</div>
<div class="line"><a name="l04463"></a><span class="lineno"> 4463</span>&#160;    IN PVOID ThreadInformation,</div>
<div class="line"><a name="l04464"></a><span class="lineno"> 4464</span>&#160;    IN ULONG ThreadInformationLength)</div>
<div class="line"><a name="l04465"></a><span class="lineno"> 4465</span>&#160;{</div>
<div class="line"><a name="l04466"></a><span class="lineno"> 4466</span>&#160;    PUSERTHREAD_FLAGS pFlags;</div>
<div class="line"><a name="l04467"></a><span class="lineno"> 4467</span>&#160;    HANDLE hClientThread;</div>
<div class="line"><a name="l04468"></a><span class="lineno"> 4468</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwOldFlags;</div>
<div class="line"><a name="l04469"></a><span class="lineno"> 4469</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> ptiT;</div>
<div class="line"><a name="l04470"></a><span class="lineno"> 4470</span>&#160;    NTSTATUS Status = STATUS_SUCCESS;</div>
<div class="line"><a name="l04471"></a><span class="lineno"> 4471</span>&#160;    <a class="code" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a> Thread;</div>
<div class="line"><a name="l04472"></a><span class="lineno"> 4472</span>&#160;    <a class="code" href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a> ThreadClient;</div>
<div class="line"><a name="l04473"></a><span class="lineno"> 4473</span>&#160;    <a class="code" href="a02889.html">PTHREADINFO</a> pti;</div>
<div class="line"><a name="l04474"></a><span class="lineno"> 4474</span>&#160;    HANDLE CsrPortHandle;</div>
<div class="line"><a name="l04475"></a><span class="lineno"> 4475</span>&#160;    <a class="code" href="a02801.html">PDESKTOP</a> pdeskClient;</div>
<div class="line"><a name="l04476"></a><span class="lineno"> 4476</span>&#160; </div>
<div class="line"><a name="l04477"></a><span class="lineno"> 4477</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04478"></a><span class="lineno"> 4478</span>&#160;<span class="comment">     * Only allow CSRSS to make this call</span></div>
<div class="line"><a name="l04479"></a><span class="lineno"> 4479</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04480"></a><span class="lineno"> 4480</span>&#160;    <span class="keywordflow">if</span> (PsGetCurrentProcess() != <a class="code" href="a03257.html#a3eabb6cc6d3b24f411b7f94f5d6edac6">gpepCSRSS</a>)</div>
<div class="line"><a name="l04481"></a><span class="lineno"> 4481</span>&#160;        <span class="keywordflow">return</span> STATUS_ACCESS_DENIED;</div>
<div class="line"><a name="l04482"></a><span class="lineno"> 4482</span>&#160; </div>
<div class="line"><a name="l04483"></a><span class="lineno"> 4483</span>&#160;    Status = ObReferenceObjectByHandle(hThread,</div>
<div class="line"><a name="l04484"></a><span class="lineno"> 4484</span>&#160;                                        THREAD_SET_INFORMATION,</div>
<div class="line"><a name="l04485"></a><span class="lineno"> 4485</span>&#160;                                        NULL,</div>
<div class="line"><a name="l04486"></a><span class="lineno"> 4486</span>&#160;                                        UserMode,</div>
<div class="line"><a name="l04487"></a><span class="lineno"> 4487</span>&#160;                                        &amp;Thread,</div>
<div class="line"><a name="l04488"></a><span class="lineno"> 4488</span>&#160;                                        NULL);</div>
<div class="line"><a name="l04489"></a><span class="lineno"> 4489</span>&#160;    <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l04490"></a><span class="lineno"> 4490</span>&#160;        <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l04491"></a><span class="lineno"> 4491</span>&#160; </div>
<div class="line"><a name="l04492"></a><span class="lineno"> 4492</span>&#160;    <span class="keywordflow">try</span> {</div>
<div class="line"><a name="l04493"></a><span class="lineno"> 4493</span>&#160;        pti = PtiFromThread(Thread);</div>
<div class="line"><a name="l04494"></a><span class="lineno"> 4494</span>&#160; </div>
<div class="line"><a name="l04495"></a><span class="lineno"> 4495</span>&#160;        <span class="keywordflow">switch</span> (ThreadInfoClass) {</div>
<div class="line"><a name="l04496"></a><span class="lineno"> 4496</span>&#160;        <span class="keywordflow">case</span> UserThreadFlags:</div>
<div class="line"><a name="l04497"></a><span class="lineno"> 4497</span>&#160;            <span class="keywordflow">if</span> (pti == NULL)</div>
<div class="line"><a name="l04498"></a><span class="lineno"> 4498</span>&#160;                Status = STATUS_INVALID_HANDLE;</div>
<div class="line"><a name="l04499"></a><span class="lineno"> 4499</span>&#160;            <span class="keywordflow">else</span> <span class="keywordflow">if</span> (ThreadInformationLength != <span class="keyword">sizeof</span>(USERTHREAD_FLAGS))</div>
<div class="line"><a name="l04500"></a><span class="lineno"> 4500</span>&#160;                Status = STATUS_INFO_LENGTH_MISMATCH;</div>
<div class="line"><a name="l04501"></a><span class="lineno"> 4501</span>&#160;            <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04502"></a><span class="lineno"> 4502</span>&#160;                pFlags = ThreadInformation;</div>
<div class="line"><a name="l04503"></a><span class="lineno"> 4503</span>&#160;                dwOldFlags = pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a>;</div>
<div class="line"><a name="l04504"></a><span class="lineno"> 4504</span>&#160;                pti-&gt;<a class="code" href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">TIF_flags</a> ^= ((dwOldFlags ^ pFlags-&gt;dwFlags) &amp; pFlags-&gt;dwMask);</div>
<div class="line"><a name="l04505"></a><span class="lineno"> 4505</span>&#160;            }</div>
<div class="line"><a name="l04506"></a><span class="lineno"> 4506</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04507"></a><span class="lineno"> 4507</span>&#160; </div>
<div class="line"><a name="l04508"></a><span class="lineno"> 4508</span>&#160;        <span class="keywordflow">case</span> UserThreadHungStatus:</div>
<div class="line"><a name="l04509"></a><span class="lineno"> 4509</span>&#160;            <span class="keywordflow">if</span> (pti == NULL)</div>
<div class="line"><a name="l04510"></a><span class="lineno"> 4510</span>&#160;                Status = STATUS_INVALID_HANDLE;</div>
<div class="line"><a name="l04511"></a><span class="lineno"> 4511</span>&#160;            <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04512"></a><span class="lineno"> 4512</span>&#160; </div>
<div class="line"><a name="l04513"></a><span class="lineno"> 4513</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04514"></a><span class="lineno"> 4514</span>&#160;<span class="comment">                 * No arguments, simple set the last time read.</span></div>
<div class="line"><a name="l04515"></a><span class="lineno"> 4515</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04516"></a><span class="lineno"> 4516</span>&#160;                SET_TIME_LAST_READ(pti);</div>
<div class="line"><a name="l04517"></a><span class="lineno"> 4517</span>&#160;            }</div>
<div class="line"><a name="l04518"></a><span class="lineno"> 4518</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04519"></a><span class="lineno"> 4519</span>&#160; </div>
<div class="line"><a name="l04520"></a><span class="lineno"> 4520</span>&#160;        <span class="keywordflow">case</span> UserThreadInitiateShutdown:</div>
<div class="line"><a name="l04521"></a><span class="lineno"> 4521</span>&#160;            <span class="keywordflow">if</span> (ThreadInformationLength != <span class="keyword">sizeof</span>(ULONG)) {</div>
<div class="line"><a name="l04522"></a><span class="lineno"> 4522</span>&#160;                Status = STATUS_INFO_LENGTH_MISMATCH;</div>
<div class="line"><a name="l04523"></a><span class="lineno"> 4523</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04524"></a><span class="lineno"> 4524</span>&#160;            }</div>
<div class="line"><a name="l04525"></a><span class="lineno"> 4525</span>&#160;            Status = <a class="code" href="a00824.html#a3c0d1abafc858da62fb0fd6777a0d6aa">InitiateShutdown</a>(Thread, (PULONG)ThreadInformation);</div>
<div class="line"><a name="l04526"></a><span class="lineno"> 4526</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04527"></a><span class="lineno"> 4527</span>&#160; </div>
<div class="line"><a name="l04528"></a><span class="lineno"> 4528</span>&#160;        <span class="keywordflow">case</span> UserThreadEndShutdown:</div>
<div class="line"><a name="l04529"></a><span class="lineno"> 4529</span>&#160;            <span class="keywordflow">if</span> (ThreadInformationLength != <span class="keyword">sizeof</span>(NTSTATUS)) {</div>
<div class="line"><a name="l04530"></a><span class="lineno"> 4530</span>&#160;                Status = STATUS_INFO_LENGTH_MISMATCH;</div>
<div class="line"><a name="l04531"></a><span class="lineno"> 4531</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04532"></a><span class="lineno"> 4532</span>&#160;            }</div>
<div class="line"><a name="l04533"></a><span class="lineno"> 4533</span>&#160;            Status = <a class="code" href="a00824.html#a5d94d9104c2ddbb9a459114768e7ffb3">EndShutdown</a>(Thread, *(NTSTATUS *)ThreadInformation);</div>
<div class="line"><a name="l04534"></a><span class="lineno"> 4534</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04535"></a><span class="lineno"> 4535</span>&#160; </div>
<div class="line"><a name="l04536"></a><span class="lineno"> 4536</span>&#160;        <span class="keywordflow">case</span> UserThreadUseDesktop:</div>
<div class="line"><a name="l04537"></a><span class="lineno"> 4537</span>&#160;            <span class="keywordflow">if</span> (ThreadInformationLength != <span class="keyword">sizeof</span>(HANDLE)) {</div>
<div class="line"><a name="l04538"></a><span class="lineno"> 4538</span>&#160;                Status = STATUS_INFO_LENGTH_MISMATCH;</div>
<div class="line"><a name="l04539"></a><span class="lineno"> 4539</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04540"></a><span class="lineno"> 4540</span>&#160;            }</div>
<div class="line"><a name="l04541"></a><span class="lineno"> 4541</span>&#160;            <span class="keywordflow">if</span> (pti == NULL) {</div>
<div class="line"><a name="l04542"></a><span class="lineno"> 4542</span>&#160;                Status = STATUS_INVALID_HANDLE;</div>
<div class="line"><a name="l04543"></a><span class="lineno"> 4543</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04544"></a><span class="lineno"> 4544</span>&#160;            }</div>
<div class="line"><a name="l04545"></a><span class="lineno"> 4545</span>&#160;            hClientThread = *(PHANDLE)ThreadInformation;</div>
<div class="line"><a name="l04546"></a><span class="lineno"> 4546</span>&#160;            <span class="keywordflow">if</span> (hClientThread == NULL) {</div>
<div class="line"><a name="l04547"></a><span class="lineno"> 4547</span>&#160;                <a class="code" href="a00656.html#a9612118d196f921acc52dcedded646c8">_SetThreadDesktop</a>(NULL, NULL);</div>
<div class="line"><a name="l04548"></a><span class="lineno"> 4548</span>&#160;                pdeskClient = NULL;</div>
<div class="line"><a name="l04549"></a><span class="lineno"> 4549</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04550"></a><span class="lineno"> 4550</span>&#160;                Status = ObReferenceObjectByHandle(hClientThread,</div>
<div class="line"><a name="l04551"></a><span class="lineno"> 4551</span>&#160;                                                THREAD_QUERY_INFORMATION,</div>
<div class="line"><a name="l04552"></a><span class="lineno"> 4552</span>&#160;                                                NULL,</div>
<div class="line"><a name="l04553"></a><span class="lineno"> 4553</span>&#160;                                                UserMode,</div>
<div class="line"><a name="l04554"></a><span class="lineno"> 4554</span>&#160;                                                &amp;ThreadClient,</div>
<div class="line"><a name="l04555"></a><span class="lineno"> 4555</span>&#160;                                                NULL);</div>
<div class="line"><a name="l04556"></a><span class="lineno"> 4556</span>&#160;                <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l04557"></a><span class="lineno"> 4557</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04558"></a><span class="lineno"> 4558</span>&#160; </div>
<div class="line"><a name="l04559"></a><span class="lineno"> 4559</span>&#160;                ptiT = PtiFromThread(ThreadClient);</div>
<div class="line"><a name="l04560"></a><span class="lineno"> 4560</span>&#160; </div>
<div class="line"><a name="l04561"></a><span class="lineno"> 4561</span>&#160;                <span class="keywordflow">if</span> (ptiT == NULL || ptiT-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a> == NULL)</div>
<div class="line"><a name="l04562"></a><span class="lineno"> 4562</span>&#160;                    Status = STATUS_INVALID_HANDLE;</div>
<div class="line"><a name="l04563"></a><span class="lineno"> 4563</span>&#160;                <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04564"></a><span class="lineno"> 4564</span>&#160;                    <span class="keywordflow">if</span> (<a class="code" href="a00656.html#a9612118d196f921acc52dcedded646c8">_SetThreadDesktop</a>(NULL, ptiT-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>))</div>
<div class="line"><a name="l04565"></a><span class="lineno"> 4565</span>&#160;                        pdeskClient = ptiT-&gt;<a class="code" href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">rpdesk</a>;</div>
<div class="line"><a name="l04566"></a><span class="lineno"> 4566</span>&#160;                    <span class="keywordflow">else</span></div>
<div class="line"><a name="l04567"></a><span class="lineno"> 4567</span>&#160;                        Status = STATUS_INVALID_HANDLE;</div>
<div class="line"><a name="l04568"></a><span class="lineno"> 4568</span>&#160;                }</div>
<div class="line"><a name="l04569"></a><span class="lineno"> 4569</span>&#160; </div>
<div class="line"><a name="l04570"></a><span class="lineno"> 4570</span>&#160;                ObDereferenceObject(ThreadClient);</div>
<div class="line"><a name="l04571"></a><span class="lineno"> 4571</span>&#160;            }</div>
<div class="line"><a name="l04572"></a><span class="lineno"> 4572</span>&#160;            <span class="keywordflow">if</span> (NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l04573"></a><span class="lineno"> 4573</span>&#160; </div>
<div class="line"><a name="l04574"></a><span class="lineno"> 4574</span>&#160;                <span class="keywordflow">if</span> (pdeskClient != NULL) {</div>
<div class="line"><a name="l04575"></a><span class="lineno"> 4575</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l04576"></a><span class="lineno"> 4576</span>&#160;<span class="comment">                     * Make sure this desktop won&#39;t go away</span></div>
<div class="line"><a name="l04577"></a><span class="lineno"> 4577</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l04578"></a><span class="lineno"> 4578</span>&#160;                    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a> == NULL) {</div>
<div class="line"><a name="l04579"></a><span class="lineno"> 4579</span>&#160;                        Status = ObReferenceObjectByPointer(pdeskClient,</div>
<div class="line"><a name="l04580"></a><span class="lineno"> 4580</span>&#160;                                                       MAXIMUM_ALLOWED,</div>
<div class="line"><a name="l04581"></a><span class="lineno"> 4581</span>&#160;                                                       *<a class="code" href="a00899.html#a6b562f476cdc12794cf052fff8d41096">ExDesktopObjectType</a>,</div>
<div class="line"><a name="l04582"></a><span class="lineno"> 4582</span>&#160;                                                       KernelMode);</div>
<div class="line"><a name="l04583"></a><span class="lineno"> 4583</span>&#160;                        <span class="keywordflow">if</span> (NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l04584"></a><span class="lineno"> 4584</span>&#160;                            pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a> = pdeskClient;</div>
<div class="line"><a name="l04585"></a><span class="lineno"> 4585</span>&#160;                            pti-&gt;<a class="code" href="a02889.html#a0bbd3e277e986d4b745d195215ff7e05">cDeskClient</a>++;</div>
<div class="line"><a name="l04586"></a><span class="lineno"> 4586</span>&#160;                        }</div>
<div class="line"><a name="l04587"></a><span class="lineno"> 4587</span>&#160;                    } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a> == pdeskClient) {</div>
<div class="line"><a name="l04588"></a><span class="lineno"> 4588</span>&#160;                        pti-&gt;<a class="code" href="a02889.html#a0bbd3e277e986d4b745d195215ff7e05">cDeskClient</a>++;</div>
<div class="line"><a name="l04589"></a><span class="lineno"> 4589</span>&#160;                    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04590"></a><span class="lineno"> 4590</span>&#160;                        Status = STATUS_INVALID_HANDLE;</div>
<div class="line"><a name="l04591"></a><span class="lineno"> 4591</span>&#160;                        <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#afa5f32de88404289ec03cd2c0e61e94f">RIP_ERROR</a>, <span class="stringliteral">&quot;SetInformationThread: pti-&gt;pdeskClient != NULL&quot;</span>);</div>
<div class="line"><a name="l04592"></a><span class="lineno"> 4592</span>&#160;                    }</div>
<div class="line"><a name="l04593"></a><span class="lineno"> 4593</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04594"></a><span class="lineno"> 4594</span>&#160;                    <span class="comment">/*</span></div>
<div class="line"><a name="l04595"></a><span class="lineno"> 4595</span>&#160;<span class="comment">                     * Don&#39;t need to hold this desktop any longer</span></div>
<div class="line"><a name="l04596"></a><span class="lineno"> 4596</span>&#160;<span class="comment">                     */</span></div>
<div class="line"><a name="l04597"></a><span class="lineno"> 4597</span>&#160;                    <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a> != NULL) {</div>
<div class="line"><a name="l04598"></a><span class="lineno"> 4598</span>&#160;                        <a class="code" href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a>(pti-&gt;<a class="code" href="a02889.html#a0bbd3e277e986d4b745d195215ff7e05">cDeskClient</a> &gt; 0);</div>
<div class="line"><a name="l04599"></a><span class="lineno"> 4599</span>&#160;                        <span class="keywordflow">if</span> (--pti-&gt;<a class="code" href="a02889.html#a0bbd3e277e986d4b745d195215ff7e05">cDeskClient</a> == 0) {</div>
<div class="line"><a name="l04600"></a><span class="lineno"> 4600</span>&#160;                            ObDereferenceObject(pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a>);</div>
<div class="line"><a name="l04601"></a><span class="lineno"> 4601</span>&#160;                            pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a> = NULL;</div>
<div class="line"><a name="l04602"></a><span class="lineno"> 4602</span>&#160;                        }</div>
<div class="line"><a name="l04603"></a><span class="lineno"> 4603</span>&#160;                    } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04604"></a><span class="lineno"> 4604</span>&#160;                        Status = STATUS_INVALID_HANDLE;</div>
<div class="line"><a name="l04605"></a><span class="lineno"> 4605</span>&#160;                        <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#afa5f32de88404289ec03cd2c0e61e94f">RIP_ERROR</a>, <span class="stringliteral">&quot;SetInformationThread: pti-&gt;pdeskClient == NULL&quot;</span>);</div>
<div class="line"><a name="l04606"></a><span class="lineno"> 4606</span>&#160;                    }</div>
<div class="line"><a name="l04607"></a><span class="lineno"> 4607</span>&#160;                }</div>
<div class="line"><a name="l04608"></a><span class="lineno"> 4608</span>&#160;            }</div>
<div class="line"><a name="l04609"></a><span class="lineno"> 4609</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04610"></a><span class="lineno"> 4610</span>&#160; </div>
<div class="line"><a name="l04611"></a><span class="lineno"> 4611</span>&#160;        <span class="keywordflow">case</span> UserThreadUseActiveDesktop:</div>
<div class="line"><a name="l04612"></a><span class="lineno"> 4612</span>&#160;            <span class="keywordflow">if</span> (pti == NULL || <a class="code" href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a> == NULL) {</div>
<div class="line"><a name="l04613"></a><span class="lineno"> 4613</span>&#160;                Status = STATUS_INVALID_HANDLE;</div>
<div class="line"><a name="l04614"></a><span class="lineno"> 4614</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04615"></a><span class="lineno"> 4615</span>&#160;            }</div>
<div class="line"><a name="l04616"></a><span class="lineno"> 4616</span>&#160;            <span class="keywordflow">if</span> (<a class="code" href="a00656.html#a9612118d196f921acc52dcedded646c8">_SetThreadDesktop</a>(NULL, <a class="code" href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a>)) {</div>
<div class="line"><a name="l04617"></a><span class="lineno"> 4617</span>&#160; </div>
<div class="line"><a name="l04618"></a><span class="lineno"> 4618</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04619"></a><span class="lineno"> 4619</span>&#160;<span class="comment">                 * Make sure this desktop won&#39;t go away</span></div>
<div class="line"><a name="l04620"></a><span class="lineno"> 4620</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04621"></a><span class="lineno"> 4621</span>&#160;                <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a> == NULL) {</div>
<div class="line"><a name="l04622"></a><span class="lineno"> 4622</span>&#160;                    Status = ObReferenceObjectByPointer(<a class="code" href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a>,</div>
<div class="line"><a name="l04623"></a><span class="lineno"> 4623</span>&#160;                                                   MAXIMUM_ALLOWED,</div>
<div class="line"><a name="l04624"></a><span class="lineno"> 4624</span>&#160;                                                   *<a class="code" href="a00899.html#a6b562f476cdc12794cf052fff8d41096">ExDesktopObjectType</a>,</div>
<div class="line"><a name="l04625"></a><span class="lineno"> 4625</span>&#160;                                                   KernelMode);</div>
<div class="line"><a name="l04626"></a><span class="lineno"> 4626</span>&#160;                    <span class="keywordflow">if</span> (NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l04627"></a><span class="lineno"> 4627</span>&#160;                        pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a> = <a class="code" href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a>;</div>
<div class="line"><a name="l04628"></a><span class="lineno"> 4628</span>&#160;                        pti-&gt;<a class="code" href="a02889.html#a0bbd3e277e986d4b745d195215ff7e05">cDeskClient</a>++;</div>
<div class="line"><a name="l04629"></a><span class="lineno"> 4629</span>&#160;                    }</div>
<div class="line"><a name="l04630"></a><span class="lineno"> 4630</span>&#160;                } <span class="keywordflow">else</span> <span class="keywordflow">if</span> (pti-&gt;<a class="code" href="a02889.html#ad823849cc4fb49252b4941b02841a65f">pdeskClient</a> == <a class="code" href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a>) {</div>
<div class="line"><a name="l04631"></a><span class="lineno"> 4631</span>&#160;                    pti-&gt;<a class="code" href="a02889.html#a0bbd3e277e986d4b745d195215ff7e05">cDeskClient</a>++;</div>
<div class="line"><a name="l04632"></a><span class="lineno"> 4632</span>&#160;                } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04633"></a><span class="lineno"> 4633</span>&#160;                    Status = STATUS_INVALID_HANDLE;</div>
<div class="line"><a name="l04634"></a><span class="lineno"> 4634</span>&#160;                    <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#afa5f32de88404289ec03cd2c0e61e94f">RIP_ERROR</a>, <span class="stringliteral">&quot;SetInformationThread: pti-&gt;pdeskClient != NULL&quot;</span>);</div>
<div class="line"><a name="l04635"></a><span class="lineno"> 4635</span>&#160;                }</div>
<div class="line"><a name="l04636"></a><span class="lineno"> 4636</span>&#160;            } <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04637"></a><span class="lineno"> 4637</span>&#160;                Status = STATUS_INVALID_HANDLE;</div>
<div class="line"><a name="l04638"></a><span class="lineno"> 4638</span>&#160;            }</div>
<div class="line"><a name="l04639"></a><span class="lineno"> 4639</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04640"></a><span class="lineno"> 4640</span>&#160; </div>
<div class="line"><a name="l04641"></a><span class="lineno"> 4641</span>&#160;        <span class="keywordflow">case</span> UserThreadCsrApiPort:</div>
<div class="line"><a name="l04642"></a><span class="lineno"> 4642</span>&#160; </div>
<div class="line"><a name="l04643"></a><span class="lineno"> 4643</span>&#160;            <span class="comment">/*</span></div>
<div class="line"><a name="l04644"></a><span class="lineno"> 4644</span>&#160;<span class="comment">             * Only CSR can call this</span></div>
<div class="line"><a name="l04645"></a><span class="lineno"> 4645</span>&#160;<span class="comment">             */</span></div>
<div class="line"><a name="l04646"></a><span class="lineno"> 4646</span>&#160;            <span class="keywordflow">if</span> (Thread-&gt;ThreadsProcess != <a class="code" href="a03257.html#a3eabb6cc6d3b24f411b7f94f5d6edac6">gpepCSRSS</a>) {</div>
<div class="line"><a name="l04647"></a><span class="lineno"> 4647</span>&#160;                Status = STATUS_ACCESS_DENIED;</div>
<div class="line"><a name="l04648"></a><span class="lineno"> 4648</span>&#160;                <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04649"></a><span class="lineno"> 4649</span>&#160;            }</div>
<div class="line"><a name="l04650"></a><span class="lineno"> 4650</span>&#160; </div>
<div class="line"><a name="l04651"></a><span class="lineno"> 4651</span>&#160;            <span class="keywordflow">if</span> (ThreadInformationLength != <span class="keyword">sizeof</span>(HANDLE))</div>
<div class="line"><a name="l04652"></a><span class="lineno"> 4652</span>&#160;                Status = STATUS_INFO_LENGTH_MISMATCH;</div>
<div class="line"><a name="l04653"></a><span class="lineno"> 4653</span>&#160;            <span class="keywordflow">else</span> {</div>
<div class="line"><a name="l04654"></a><span class="lineno"> 4654</span>&#160; </div>
<div class="line"><a name="l04655"></a><span class="lineno"> 4655</span>&#160;                <span class="comment">/*</span></div>
<div class="line"><a name="l04656"></a><span class="lineno"> 4656</span>&#160;<span class="comment">                 * Only set it once.</span></div>
<div class="line"><a name="l04657"></a><span class="lineno"> 4657</span>&#160;<span class="comment">                 */</span></div>
<div class="line"><a name="l04658"></a><span class="lineno"> 4658</span>&#160;                <span class="keywordflow">if</span> (<a class="code" href="a03257.html#a8c923ab482ca462b6451fe83500d4a6b">CsrApiPort</a> != NULL)</div>
<div class="line"><a name="l04659"></a><span class="lineno"> 4659</span>&#160;                    <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04660"></a><span class="lineno"> 4660</span>&#160; </div>
<div class="line"><a name="l04661"></a><span class="lineno"> 4661</span>&#160;                CsrPortHandle = *(PHANDLE)ThreadInformation;</div>
<div class="line"><a name="l04662"></a><span class="lineno"> 4662</span>&#160;                Status = ObReferenceObjectByHandle(</div>
<div class="line"><a name="l04663"></a><span class="lineno"> 4663</span>&#160;                        CsrPortHandle,</div>
<div class="line"><a name="l04664"></a><span class="lineno"> 4664</span>&#160;                        0,</div>
<div class="line"><a name="l04665"></a><span class="lineno"> 4665</span>&#160;                        NULL,</div>
<div class="line"><a name="l04666"></a><span class="lineno"> 4666</span>&#160;                        UserMode,</div>
<div class="line"><a name="l04667"></a><span class="lineno"> 4667</span>&#160;                        &amp;<a class="code" href="a03257.html#a8c923ab482ca462b6451fe83500d4a6b">CsrApiPort</a>,</div>
<div class="line"><a name="l04668"></a><span class="lineno"> 4668</span>&#160;                        NULL);</div>
<div class="line"><a name="l04669"></a><span class="lineno"> 4669</span>&#160;                <span class="keywordflow">if</span> (!NT_SUCCESS(Status)) {</div>
<div class="line"><a name="l04670"></a><span class="lineno"> 4670</span>&#160;                    <a class="code" href="a03257.html#a8c923ab482ca462b6451fe83500d4a6b">CsrApiPort</a> = NULL;</div>
<div class="line"><a name="l04671"></a><span class="lineno"> 4671</span>&#160;                    <a class="code" href="a00371.html#a31aafffb49dfe98bdc749c9b35c90162">RIPMSG1</a>(<a class="code" href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a>,</div>
<div class="line"><a name="l04672"></a><span class="lineno"> 4672</span>&#160;                            <span class="stringliteral">&quot;CSR port reference failed, Status=%#lx&quot;</span>,</div>
<div class="line"><a name="l04673"></a><span class="lineno"> 4673</span>&#160;                            Status);</div>
<div class="line"><a name="l04674"></a><span class="lineno"> 4674</span>&#160;                }</div>
<div class="line"><a name="l04675"></a><span class="lineno"> 4675</span>&#160;            }</div>
<div class="line"><a name="l04676"></a><span class="lineno"> 4676</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04677"></a><span class="lineno"> 4677</span>&#160; </div>
<div class="line"><a name="l04678"></a><span class="lineno"> 4678</span>&#160;        <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l04679"></a><span class="lineno"> 4679</span>&#160;            Status = STATUS_INVALID_INFO_CLASS;</div>
<div class="line"><a name="l04680"></a><span class="lineno"> 4680</span>&#160;            <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04681"></a><span class="lineno"> 4681</span>&#160;        }</div>
<div class="line"><a name="l04682"></a><span class="lineno"> 4682</span>&#160; </div>
<div class="line"><a name="l04683"></a><span class="lineno"> 4683</span>&#160;        UnlockThread(Thread);</div>
<div class="line"><a name="l04684"></a><span class="lineno"> 4684</span>&#160;        }</div>
<div class="line"><a name="l04685"></a><span class="lineno"> 4685</span>&#160;    except (EXCEPTION_EXECUTE_HANDLER) {</div>
<div class="line"><a name="l04686"></a><span class="lineno"> 4686</span>&#160;        UnlockThread(Thread);</div>
<div class="line"><a name="l04687"></a><span class="lineno"> 4687</span>&#160;        Status = GetExceptionCode();</div>
<div class="line"><a name="l04688"></a><span class="lineno"> 4688</span>&#160;        }</div>
<div class="line"><a name="l04689"></a><span class="lineno"> 4689</span>&#160; </div>
<div class="line"><a name="l04690"></a><span class="lineno"> 4690</span>&#160;    <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l04691"></a><span class="lineno"> 4691</span>&#160;}</div>
<div class="line"><a name="l04692"></a><span class="lineno"> 4692</span>&#160; </div>
<div class="line"><a name="l04693"></a><span class="lineno"> 4693</span>&#160; </div>
<div class="line"><a name="l04694"></a><span class="lineno"> 4694</span>&#160; </div>
<div class="line"><a name="l04703"></a><span class="lineno"><a class="line" href="a00899.html#a734cea1951ba634070f292cc3ffa68a3"> 4703</a></span>&#160;NTSTATUS <a class="code" href="a00824.html#a734cea1951ba634070f292cc3ffa68a3">ConsoleControl</a>(</div>
<div class="line"><a name="l04704"></a><span class="lineno"> 4704</span>&#160;    IN CONSOLECONTROL <a class="code" href="a00824.html#a734cea1951ba634070f292cc3ffa68a3">ConsoleControl</a>,</div>
<div class="line"><a name="l04705"></a><span class="lineno"> 4705</span>&#160;    IN PVOID ConsoleInformation,</div>
<div class="line"><a name="l04706"></a><span class="lineno"> 4706</span>&#160;    IN ULONG ConsoleInformationLength)</div>
<div class="line"><a name="l04707"></a><span class="lineno"> 4707</span>&#160;{</div>
<div class="line"><a name="l04708"></a><span class="lineno"> 4708</span>&#160;    PCONSOLEDESKTOPCONSOLETHREAD pDesktopConsole;</div>
<div class="line"><a name="l04709"></a><span class="lineno"> 4709</span>&#160;    PCONSOLEWINDOWSTATIONPROCESS pConsoleWindowStationInfo;</div>
<div class="line"><a name="l04710"></a><span class="lineno"> 4710</span>&#160;    <a class="code" href="a02801.html">PDESKTOP</a> pdesk;</div>
<div class="line"><a name="l04711"></a><span class="lineno"> 4711</span>&#160;    <a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a> dwThreadIdOld;</div>
<div class="line"><a name="l04712"></a><span class="lineno"> 4712</span>&#160;    BOOL fSuccess;</div>
<div class="line"><a name="l04713"></a><span class="lineno"> 4713</span>&#160;    NTSTATUS Status;</div>
<div class="line"><a name="l04714"></a><span class="lineno"> 4714</span>&#160; </div>
<div class="line"><a name="l04715"></a><span class="lineno"> 4715</span>&#160;    <span class="comment">/*</span></div>
<div class="line"><a name="l04716"></a><span class="lineno"> 4716</span>&#160;<span class="comment">     * Only allow CSRSS to make this call</span></div>
<div class="line"><a name="l04717"></a><span class="lineno"> 4717</span>&#160;<span class="comment">     */</span></div>
<div class="line"><a name="l04718"></a><span class="lineno"> 4718</span>&#160;    <span class="keywordflow">if</span> (PsGetCurrentProcess() != <a class="code" href="a03257.html#a3eabb6cc6d3b24f411b7f94f5d6edac6">gpepCSRSS</a>)</div>
<div class="line"><a name="l04719"></a><span class="lineno"> 4719</span>&#160;        <span class="keywordflow">return</span> STATUS_ACCESS_DENIED;</div>
<div class="line"><a name="l04720"></a><span class="lineno"> 4720</span>&#160; </div>
<div class="line"><a name="l04721"></a><span class="lineno"> 4721</span>&#160;    <span class="keywordflow">switch</span> (<a class="code" href="a00824.html#a734cea1951ba634070f292cc3ffa68a3">ConsoleControl</a>) {</div>
<div class="line"><a name="l04722"></a><span class="lineno"> 4722</span>&#160;    <span class="keywordflow">case</span> ConsoleDesktopConsoleThread:</div>
<div class="line"><a name="l04723"></a><span class="lineno"> 4723</span>&#160;        <span class="keywordflow">if</span> (ConsoleInformationLength != <span class="keyword">sizeof</span>(CONSOLEDESKTOPCONSOLETHREAD))</div>
<div class="line"><a name="l04724"></a><span class="lineno"> 4724</span>&#160;            <span class="keywordflow">return</span> STATUS_INFO_LENGTH_MISMATCH;</div>
<div class="line"><a name="l04725"></a><span class="lineno"> 4725</span>&#160;        pDesktopConsole = (PCONSOLEDESKTOPCONSOLETHREAD)ConsoleInformation;</div>
<div class="line"><a name="l04726"></a><span class="lineno"> 4726</span>&#160; </div>
<div class="line"><a name="l04727"></a><span class="lineno"> 4727</span>&#160;        Status = ObReferenceObjectByHandle(</div>
<div class="line"><a name="l04728"></a><span class="lineno"> 4728</span>&#160;                pDesktopConsole-&gt;hdesk,</div>
<div class="line"><a name="l04729"></a><span class="lineno"> 4729</span>&#160;                0,</div>
<div class="line"><a name="l04730"></a><span class="lineno"> 4730</span>&#160;                *<a class="code" href="a00899.html#a6b562f476cdc12794cf052fff8d41096">ExDesktopObjectType</a>,</div>
<div class="line"><a name="l04731"></a><span class="lineno"> 4731</span>&#160;                UserMode,</div>
<div class="line"><a name="l04732"></a><span class="lineno"> 4732</span>&#160;                &amp;pdesk,</div>
<div class="line"><a name="l04733"></a><span class="lineno"> 4733</span>&#160;                NULL);</div>
<div class="line"><a name="l04734"></a><span class="lineno"> 4734</span>&#160;        <span class="keywordflow">if</span> (!NT_SUCCESS(Status))</div>
<div class="line"><a name="l04735"></a><span class="lineno"> 4735</span>&#160;            <span class="keywordflow">return</span> Status;</div>
<div class="line"><a name="l04736"></a><span class="lineno"> 4736</span>&#160; </div>
<div class="line"><a name="l04737"></a><span class="lineno"> 4737</span>&#160;        dwThreadIdOld = pdesk-&gt;<a class="code" href="a02801.html#aa5a1d482d42aa7bc00013ae77771910a">dwConsoleThreadId</a>;</div>
<div class="line"><a name="l04738"></a><span class="lineno"> 4738</span>&#160; </div>
<div class="line"><a name="l04739"></a><span class="lineno"> 4739</span>&#160;        <span class="keywordflow">if</span> (pDesktopConsole-&gt;dwThreadId != (<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>)-1) {</div>
<div class="line"><a name="l04740"></a><span class="lineno"> 4740</span>&#160;            pdesk-&gt;<a class="code" href="a02801.html#aa5a1d482d42aa7bc00013ae77771910a">dwConsoleThreadId</a> =</div>
<div class="line"><a name="l04741"></a><span class="lineno"> 4741</span>&#160;                    pDesktopConsole-&gt;dwThreadId;</div>
<div class="line"><a name="l04742"></a><span class="lineno"> 4742</span>&#160;        }</div>
<div class="line"><a name="l04743"></a><span class="lineno"> 4743</span>&#160; </div>
<div class="line"><a name="l04744"></a><span class="lineno"> 4744</span>&#160;        pDesktopConsole-&gt;dwThreadId = dwThreadIdOld;</div>
<div class="line"><a name="l04745"></a><span class="lineno"> 4745</span>&#160;        ObDereferenceObject(pdesk);</div>
<div class="line"><a name="l04746"></a><span class="lineno"> 4746</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04747"></a><span class="lineno"> 4747</span>&#160; </div>
<div class="line"><a name="l04748"></a><span class="lineno"> 4748</span>&#160;    <span class="keywordflow">case</span> ConsoleClassAtom:</div>
<div class="line"><a name="l04749"></a><span class="lineno"> 4749</span>&#160;        <span class="keywordflow">if</span> (ConsoleInformationLength != <span class="keyword">sizeof</span>(ATOM))</div>
<div class="line"><a name="l04750"></a><span class="lineno"> 4750</span>&#160;            <span class="keywordflow">return</span> STATUS_INFO_LENGTH_MISMATCH;</div>
<div class="line"><a name="l04751"></a><span class="lineno"> 4751</span>&#160;        <a class="code" href="a03257.html#a9b6418db6c0448790ef82314b1d46088">gatomConsoleClass</a> = *(ATOM *)ConsoleInformation;</div>
<div class="line"><a name="l04752"></a><span class="lineno"> 4752</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04753"></a><span class="lineno"> 4753</span>&#160; </div>
<div class="line"><a name="l04754"></a><span class="lineno"> 4754</span>&#160;    <span class="keywordflow">case</span> ConsolePermanentFont:</div>
<div class="line"><a name="l04755"></a><span class="lineno"> 4755</span>&#160;        fSuccess = (BOOL)<a class="code" href="a00719.html#a6fbaa4f2c3cf36d69c0400f1413ac858">xxxAddFontResourceW</a>((LPWSTR)ConsoleInformation,</div>
<div class="line"><a name="l04756"></a><span class="lineno"> 4756</span>&#160;                                              AFRW_ADD_LOCAL_FONT);</div>
<div class="line"><a name="l04757"></a><span class="lineno"> 4757</span>&#160;        <span class="keywordflow">if</span> (!fSuccess)</div>
<div class="line"><a name="l04758"></a><span class="lineno"> 4758</span>&#160;            <span class="keywordflow">return</span> STATUS_UNSUCCESSFUL;</div>
<div class="line"><a name="l04759"></a><span class="lineno"> 4759</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04760"></a><span class="lineno"> 4760</span>&#160; </div>
<div class="line"><a name="l04761"></a><span class="lineno"> 4761</span>&#160;    <span class="keywordflow">case</span> ConsoleNotifyConsoleApplication:</div>
<div class="line"><a name="l04762"></a><span class="lineno"> 4762</span>&#160;        <span class="keywordflow">if</span> (ConsoleInformationLength != <span class="keyword">sizeof</span>(<a class="code" href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a>))</div>
<div class="line"><a name="l04763"></a><span class="lineno"> 4763</span>&#160;            <span class="keywordflow">return</span> STATUS_INFO_LENGTH_MISMATCH;</div>
<div class="line"><a name="l04764"></a><span class="lineno"> 4764</span>&#160;        <a class="code" href="a00824.html#a507668fdd19718f6de8825719bf23632">UserNotifyConsoleApplication</a>(*(LPDWORD)ConsoleInformation);</div>
<div class="line"><a name="l04765"></a><span class="lineno"> 4765</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04766"></a><span class="lineno"> 4766</span>&#160; </div>
<div class="line"><a name="l04767"></a><span class="lineno"> 4767</span>&#160;    <span class="keywordflow">case</span> ConsoleSetVDMCursorBounds:</div>
<div class="line"><a name="l04768"></a><span class="lineno"> 4768</span>&#160;        <span class="keywordflow">if</span> ((ConsoleInformation != NULL) &amp;&amp;</div>
<div class="line"><a name="l04769"></a><span class="lineno"> 4769</span>&#160;            (ConsoleInformationLength != <span class="keyword">sizeof</span>(RECT)))</div>
<div class="line"><a name="l04770"></a><span class="lineno"> 4770</span>&#160;        {</div>
<div class="line"><a name="l04771"></a><span class="lineno"> 4771</span>&#160;            <span class="keywordflow">return</span> STATUS_INFO_LENGTH_MISMATCH;</div>
<div class="line"><a name="l04772"></a><span class="lineno"> 4772</span>&#160;        }</div>
<div class="line"><a name="l04773"></a><span class="lineno"> 4773</span>&#160;        <a class="code" href="a00824.html#a317b5986c94a0fe6aec5cd38123cf2a3">SetVDMCursorBounds</a>(ConsoleInformation);</div>
<div class="line"><a name="l04774"></a><span class="lineno"> 4774</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04775"></a><span class="lineno"> 4775</span>&#160; </div>
<div class="line"><a name="l04776"></a><span class="lineno"> 4776</span>&#160;    <span class="keywordflow">case</span> ConsolePublicPalette:</div>
<div class="line"><a name="l04777"></a><span class="lineno"> 4777</span>&#160;        <span class="keywordflow">if</span> (ConsoleInformationLength != <span class="keyword">sizeof</span>(HPALETTE))</div>
<div class="line"><a name="l04778"></a><span class="lineno"> 4778</span>&#160;            <span class="keywordflow">return</span> STATUS_INFO_LENGTH_MISMATCH;</div>
<div class="line"><a name="l04779"></a><span class="lineno"> 4779</span>&#160;        GreSetPaletteOwner(*(HPALETTE *)ConsoleInformation, OBJECT_OWNER_PUBLIC);</div>
<div class="line"><a name="l04780"></a><span class="lineno"> 4780</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04781"></a><span class="lineno"> 4781</span>&#160; </div>
<div class="line"><a name="l04782"></a><span class="lineno"> 4782</span>&#160;    <span class="keywordflow">case</span> ConsoleWindowStationProcess:</div>
<div class="line"><a name="l04783"></a><span class="lineno"> 4783</span>&#160;        <span class="keywordflow">if</span> (ConsoleInformationLength != <span class="keyword">sizeof</span>(CONSOLEWINDOWSTATIONPROCESS))</div>
<div class="line"><a name="l04784"></a><span class="lineno"> 4784</span>&#160;            <span class="keywordflow">return</span> STATUS_INFO_LENGTH_MISMATCH;</div>
<div class="line"><a name="l04785"></a><span class="lineno"> 4785</span>&#160; </div>
<div class="line"><a name="l04786"></a><span class="lineno"> 4786</span>&#160;        pConsoleWindowStationInfo = (PCONSOLEWINDOWSTATIONPROCESS)ConsoleInformation;</div>
<div class="line"><a name="l04787"></a><span class="lineno"> 4787</span>&#160;        <a class="code" href="a00824.html#aa91fe5efc8921eb5856bfe012972c2b3">UserSetConsoleProcessWindowStation</a>(pConsoleWindowStationInfo-&gt;dwProcessId,</div>
<div class="line"><a name="l04788"></a><span class="lineno"> 4788</span>&#160;                                           pConsoleWindowStationInfo-&gt;hwinsta);</div>
<div class="line"><a name="l04789"></a><span class="lineno"> 4789</span>&#160;        <span class="keywordflow">break</span>;</div>
<div class="line"><a name="l04790"></a><span class="lineno"> 4790</span>&#160; </div>
<div class="line"><a name="l04791"></a><span class="lineno"> 4791</span>&#160;    <span class="keywordflow">default</span>:</div>
<div class="line"><a name="l04792"></a><span class="lineno"> 4792</span>&#160;        <a class="code" href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a>(<a class="code" href="a00371.html#afa5f32de88404289ec03cd2c0e61e94f">RIP_ERROR</a>, <span class="stringliteral">&quot;ConsoleControl - invalid control class\n&quot;</span>);</div>
<div class="line"><a name="l04793"></a><span class="lineno"> 4793</span>&#160;        <span class="keywordflow">return</span> STATUS_INVALID_INFO_CLASS;</div>
<div class="line"><a name="l04794"></a><span class="lineno"> 4794</span>&#160;    }</div>
<div class="line"><a name="l04795"></a><span class="lineno"> 4795</span>&#160;    <span class="keywordflow">return</span> STATUS_SUCCESS;</div>
<div class="line"><a name="l04796"></a><span class="lineno"> 4796</span>&#160;}</div>
</div><!-- fragment --></div><!-- contents -->
</div><!-- doc-content -->
<div class="ttc" id="aa02889_html_a63f9a7301bdb8da51c5180336650f449"><div class="ttname"><a href="a02889.html#a63f9a7301bdb8da51c5180336650f449">tagTHREADINFO::timeLast</a></div><div class="ttdeci">LONG timeLast</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02302">userk.h:2302</a></div></div>
<div class="ttc" id="aa00824_html_a5d94d9104c2ddbb9a459114768e7ffb3"><div class="ttname"><a href="a00824.html#a5d94d9104c2ddbb9a459114768e7ffb3">EndShutdown</a></div><div class="ttdeci">NTSTATUS EndShutdown(PETHREAD Thread, NTSTATUS StatusShutdown)</div><div class="ttdef"><b>Definition:</b> <a href="a03236_source.html#l00255">kernel/exitwin.c:255</a></div></div>
<div class="ttc" id="aa02649_html_a1fc053b04d0e037452d1efb7426bd89c"><div class="ttname"><a href="a02649.html#a1fc053b04d0e037452d1efb7426bd89c">tagCLIENTTHREADINFO::fsWakeBits</a></div><div class="ttdeci">WORD fsWakeBits</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l02218">user.h:2218</a></div></div>
<div class="ttc" id="aa02889_html_ae8b869ec5b101646649020f5b0fd5d0d"><div class="ttname"><a href="a02889.html#ae8b869ec5b101646649020f5b0fd5d0d">tagTHREADINFO::TIF_flags</a></div><div class="ttdeci">DWORD TIF_flags</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02294">userk.h:2294</a></div></div>
<div class="ttc" id="aa02873_html"><div class="ttname"><a href="a02873.html">tagATTACHINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02204">userk.h:2204</a></div></div>
<div class="ttc" id="aa02773_html"><div class="ttname"><a href="a02773.html">tagSMWP</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01592">userk.h:1592</a></div></div>
<div class="ttc" id="aa02889_html_aa96b1486618d15fb0b653be689092c8e"><div class="ttname"><a href="a02889.html#aa96b1486618d15fb0b653be689092c8e">tagTHREADINFO::apEvent</a></div><div class="ttdeci">PKEVENT * apEvent</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02286">userk.h:2286</a></div></div>
<div class="ttc" id="aa00899_html_a1e8f3de1ac479af792360b59a0a80bc7"><div class="ttname"><a href="a00899.html#a1e8f3de1ac479af792360b59a0a80bc7">CheckSysLock</a></div><div class="ttdeci">void CheckSysLock(int where, PQ pq, PTHREADINFO pti)</div></div>
<div class="ttc" id="aa03290_html_a0dee150599c13a9794347efe8e435f6f"><div class="ttname"><a href="a03290.html#a0dee150599c13a9794347efe8e435f6f">FreeKeyState</a></div><div class="ttdeci">void FreeKeyState(PBYTE pKeyState)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01666">kernel/input.c:1666</a></div></div>
<div class="ttc" id="aa02837_html_ae7274a49cb78fdb7c1f0665fcf883fef"><div class="ttname"><a href="a02837.html#ae7274a49cb78fdb7c1f0665fcf883fef">tagPOPUPMENU::fDestroyed</a></div><div class="ttdeci">DWORD fDestroyed</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01910">userk.h:1910</a></div></div>
<div class="ttc" id="aa00371_html_a01c4659626880ba56745765a3580a36b"><div class="ttname"><a href="a00371.html#a01c4659626880ba56745765a3580a36b">RIPMSG0</a></div><div class="ttdeci">#define RIPMSG0(flags, szFmt)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00131">winerrp.h:131</a></div></div>
<div class="ttc" id="aa02869_html_a63df655cf92843da82e0c872b65baef1"><div class="ttname"><a href="a02869.html#a63df655cf92843da82e0c872b65baef1">tagQ::cThreads</a></div><div class="ttdeci">USHORT cThreads</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02189">userk.h:2189</a></div></div>
<div class="ttc" id="aa02865_html_a2e8d29c336ad6665d4f0657648582ae5"><div class="ttname"><a href="a02865.html#a2e8d29c336ad6665d4f0657648582ae5">tagMLIST::pqmsgWriteLast</a></div><div class="ttdeci">PQMSG pqmsgWriteLast</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02149">userk.h:2149</a></div></div>
<div class="ttc" id="aa02477_html_a3c509629a36511ee0d17273de6b9d6af"><div class="ttname"><a href="a02477.html#a3c509629a36511ee0d17273de6b9d6af">_CLIENTINFO::dwTIFlags</a></div><div class="ttdeci">DWORD dwTIFlags</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00378">user.h:378</a></div></div>
<div class="ttc" id="aa02889_html_ace0cb78fad7ebb7cfd46f3918700cff8"><div class="ttname"><a href="a02889.html#ace0cb78fad7ebb7cfd46f3918700cff8">tagTHREADINFO::spDefaultImc</a></div><div class="ttdeci">PIMC spDefaultImc</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02345">userk.h:2345</a></div></div>
<div class="ttc" id="aa02889_html_a7f41a9bbcd2f30304020b54827564df4"><div class="ttname"><a href="a02889.html#a7f41a9bbcd2f30304020b54827564df4">tagTHREADINFO::pMenuState</a></div><div class="ttdeci">PMENUSTATE pMenuState</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02312">userk.h:2312</a></div></div>
<div class="ttc" id="aa02637_html_a3f1141bdb9085129668459f2df4d9d4f"><div class="ttname"><a href="a02637.html#a3f1141bdb9085129668459f2df4d9d4f">tagSBTRACK::spwndSBNotify</a></div><div class="ttdeci">PWND spwndSBNotify</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l02071">user.h:2071</a></div></div>
<div class="ttc" id="aa00842_html_af793abfba936a5b6bdca9f922db92874"><div class="ttname"><a href="a00842.html#af793abfba936a5b6bdca9f922db92874">SendMsgCleanup</a></div><div class="ttdeci">VOID SendMsgCleanup(PTHREADINFO ptiCurrent)</div><div class="ttdef"><b>Definition:</b> <a href="a00842_source.html#l02283">sendmsg.c:2283</a></div></div>
<div class="ttc" id="aa00824_html_a089b1ee79d56a4319e4ec556c2d20423"><div class="ttname"><a href="a00824.html#a089b1ee79d56a4319e4ec556c2d20423">DebugValidateMLISTandQMSG</a></div><div class="ttdeci">#define DebugValidateMLISTandQMSG(pml, pqmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00116">queue.c:116</a></div></div>
<div class="ttc" id="aa00824_html_a20d4e3ea15f4d047785697f4c14e94c7"><div class="ttname"><a href="a00824.html#a20d4e3ea15f4d047785697f4c14e94c7">InitProcessInfo</a></div><div class="ttdeci">BOOL InitProcessInfo(PW32PROCESS pwp)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03534">queue.c:3534</a></div></div>
<div class="ttc" id="aa00566_html_aefdbe49968222157e86f468e4563f083"><div class="ttname"><a href="a00566.html#aefdbe49968222157e86f468e4563f083">c</a></div><div class="ttdeci">code to userexts c</div><div class="ttdef"><b>Definition:</b> <a href="a00566_source.html#l00012">genuedef.c:12</a></div></div>
<div class="ttc" id="aa00824_html_ac029c0868dfa0a33a2bdd9f9c3633342"><div class="ttname"><a href="a00824.html#ac029c0868dfa0a33a2bdd9f9c3633342">_ShowStartGlass</a></div><div class="ttdeci">void _ShowStartGlass(DWORD dwTimeout)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00867">queue.c:867</a></div></div>
<div class="ttc" id="aa02873_html_a23f4b2005ab46e384ad14699e7a6eff7"><div class="ttname"><a href="a02873.html#a23f4b2005ab46e384ad14699e7a6eff7">tagATTACHINFO::paiNext</a></div><div class="ttdeci">struct tagATTACHINFO * paiNext</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02205">userk.h:2205</a></div></div>
<div class="ttc" id="aa02869_html_ab38e745019cf5314eea3e78229d367c3"><div class="ttname"><a href="a02869.html#ab38e745019cf5314eea3e78229d367c3">tagQ::ptiMouse</a></div><div class="ttdeci">PTHREADINFO ptiMouse</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02163">userk.h:2163</a></div></div>
<div class="ttc" id="aa00881_html_ae11878514dabd4ba1a2c58dd2bcf2d4d"><div class="ttname"><a href="a00881.html#ae11878514dabd4ba1a2c58dd2bcf2d4d">xxxSleepTask</a></div><div class="ttdeci">BOOL xxxSleepTask(BOOL fInputIdle, HANDLE hEvent)</div><div class="ttdef"><b>Definition:</b> <a href="a00881_source.html#l00234">taskman.c:234</a></div></div>
<div class="ttc" id="aa00824_html_a625f273e3c887a8cf38f78db6d144bca"><div class="ttname"><a href="a00824.html#a625f273e3c887a8cf38f78db6d144bca">ProcessUpdateKeyStateEvent</a></div><div class="ttdeci">void ProcessUpdateKeyStateEvent(PQ pq, PBYTE pbKeyState)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01816">kernel/input.c:1816</a></div></div>
<div class="ttc" id="aa02869_html_a93898ca4e261db30e33fcebd6b74cd0a"><div class="ttname"><a href="a02869.html#a93898ca4e261db30e33fcebd6b74cd0a">tagQ::spwndLastMouseMessage</a></div><div class="ttdeci">PWND spwndLastMouseMessage</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02196">userk.h:2196</a></div></div>
<div class="ttc" id="aa00656_html_adab7753eb3b9c19ddc0f7e5218d350fc"><div class="ttname"><a href="a00656.html#adab7753eb3b9c19ddc0f7e5218d350fc">SetDesktop</a></div><div class="ttdeci">VOID SetDesktop(PTHREADINFO pti, PDESKTOP pdesk, HDESK hdesk)</div><div class="ttdef"><b>Definition:</b> <a href="a00656_source.html#l02706">desktop.c:2706</a></div></div>
<div class="ttc" id="aa02889_html_a4c966c8862344a6b01ddbc4d26a9fe2f"><div class="ttname"><a href="a02889.html#a4c966c8862344a6b01ddbc4d26a9fe2f">tagTHREADINFO::spwndDefaultIme</a></div><div class="ttdeci">PWND spwndDefaultIme</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02344">userk.h:2344</a></div></div>
<div class="ttc" id="aa02869_html_a50df387cc5ba51033fb9e767c430f72f"><div class="ttname"><a href="a02869.html#a50df387cc5ba51033fb9e767c430f72f">tagQ::spwndCapture</a></div><div class="ttdeci">PWND spwndCapture</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02166">userk.h:2166</a></div></div>
<div class="ttc" id="aa02865_html"><div class="ttname"><a href="a02865.html">tagMLIST</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02147">userk.h:2147</a></div></div>
<div class="ttc" id="aa00899_html_a710dc7b3a0a3fbfe00315b133ab633de"><div class="ttname"><a href="a00899.html#a710dc7b3a0a3fbfe00315b133ab633de">MSGWAITCALLBACK</a></div><div class="ttdeci">VOID(CALLBACK * MSGWAITCALLBACK)(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l04211">userk.h:4211</a></div></div>
<div class="ttc" id="aa03257_html_a8c923ab482ca462b6451fe83500d4a6b"><div class="ttname"><a href="a03257.html#a8c923ab482ca462b6451fe83500d4a6b">CsrApiPort</a></div><div class="ttdeci">HANDLE CsrApiPort</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00055">kernel/globals.c:55</a></div></div>
<div class="ttc" id="aa02869_html_a950fb049dd2c207bcda1f2a2c3912cc9"><div class="ttname"><a href="a02869.html#a950fb049dd2c207bcda1f2a2c3912cc9">tagQ::spwndActivePrev</a></div><div class="ttdeci">PWND spwndActivePrev</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02169">userk.h:2169</a></div></div>
<div class="ttc" id="aa00824_html_a7a7fb081b27165c43974d89be67bbad8"><div class="ttname"><a href="a00824.html#a7a7fb081b27165c43974d89be67bbad8">SetWakeBit</a></div><div class="ttdeci">VOID SetWakeBit(PTHREADINFO pti, UINT wWakeBit)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03276">queue.c:3276</a></div></div>
<div class="ttc" id="aa00899_html_a6b562f476cdc12794cf052fff8d41096"><div class="ttname"><a href="a00899.html#a6b562f476cdc12794cf052fff8d41096">ExDesktopObjectType</a></div><div class="ttdeci">POBJECT_TYPE * ExDesktopObjectType</div></div>
<div class="ttc" id="aa03257_html_ad4b0bbbb1f1fce28a4e874ae6fb92262"><div class="ttname"><a href="a03257.html#ad4b0bbbb1f1fce28a4e874ae6fb92262">gpidLogon</a></div><div class="ttdeci">HANDLE gpidLogon</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00183">kernel/globals.c:183</a></div></div>
<div class="ttc" id="aa00824_html_a6234fc19d7c15559264915103e34035d"><div class="ttname"><a href="a00824.html#a6234fc19d7c15559264915103e34035d">FreeQueue</a></div><div class="ttdeci">VOID FreeQueue(PQ pq)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l01475">queue.c:1475</a></div></div>
<div class="ttc" id="aa02553_html"><div class="ttname"><a href="a02553.html">_HANDLEENTRY</a></div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01165">user.h:1165</a></div></div>
<div class="ttc" id="aa02837_html_a472df270c88db7755093cd3ca1d1dee6"><div class="ttname"><a href="a02837.html#a472df270c88db7755093cd3ca1d1dee6">tagPOPUPMENU::spwndNotify</a></div><div class="ttdeci">struct tagWND * spwndNotify</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01936">userk.h:1936</a></div></div>
<div class="ttc" id="aa00899_html_ae451a2dc8791c420d7c956a63adc33ba"><div class="ttname"><a href="a00899.html#ae451a2dc8791c420d7c956a63adc33ba">EnterCrit</a></div><div class="ttdeci">VOID EnterCrit(VOID)</div></div>
<div class="ttc" id="aa02889_html_a44b5958e6b5534a50ebdf2fe332d8118"><div class="ttname"><a href="a02889.html#a44b5958e6b5534a50ebdf2fe332d8118">tagTHREADINFO::dwCompatFlags</a></div><div class="ttdeci">DWORD dwCompatFlags</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02322">userk.h:2322</a></div></div>
<div class="ttc" id="aa02953_html"><div class="ttname"><a href="a02953.html">tagASYNCSENDMSG</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02660">userk.h:2660</a></div></div>
<div class="ttc" id="aa02869_html_a0ab106d34ad5aa9c1fdcd2eba652623e"><div class="ttname"><a href="a02869.html#a0ab106d34ad5aa9c1fdcd2eba652623e">tagQ::mlInput</a></div><div class="ttdeci">MLIST mlInput</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02157">userk.h:2157</a></div></div>
<div class="ttc" id="aa02913_html_a970dc45b98f6c52923abdab05a49f02a"><div class="ttname"><a href="a02913.html#a970dc45b98f6c52923abdab05a49f02a">tagBWL::ptiOwner</a></div><div class="ttdeci">PTHREADINFO ptiOwner</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02497">userk.h:2497</a></div></div>
<div class="ttc" id="aa00824_html_a5fe304d96dc6f187ba69392175042daa"><div class="ttname"><a href="a00824.html#a5fe304d96dc6f187ba69392175042daa">SetInformationThread</a></div><div class="ttdeci">NTSTATUS SetInformationThread(IN HANDLE hThread, IN USERTHREADINFOCLASS ThreadInfoClass, IN PVOID ThreadInformation, IN ULONG ThreadInformationLength)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l04460">queue.c:4460</a></div></div>
<div class="ttc" id="aa02897_html_ada49aaf1057fad79a982d750d995b8c2"><div class="ttname"><a href="a02897.html#ada49aaf1057fad79a982d750d995b8c2">tagWOWPROCESSINFO::pEventWowExec</a></div><div class="ttdeci">PKEVENT pEventWowExec</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02368">userk.h:2368</a></div></div>
<div class="ttc" id="aa02877_html_acdfce03ff716b350b5b599cfd8717b3a"><div class="ttname"><a href="a02877.html#acdfce03ff716b350b5b599cfd8717b3a">tagWOWTHREADINFO::pwtiNext</a></div><div class="ttdeci">struct tagWOWTHREADINFO * pwtiNext</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02220">userk.h:2220</a></div></div>
<div class="ttc" id="aa00632_html_adb86eff45b43742749df3cabd77d63c4"><div class="ttname"><a href="a00632.html#adb86eff45b43742749df3cabd77d63c4">xxxCloseClipboard</a></div><div class="ttdeci">BOOL xxxCloseClipboard(PWINDOWSTATION pwinsta)</div><div class="ttdef"><b>Definition:</b> <a href="a00632_source.html#l00480">clipbrd.c:480</a></div></div>
<div class="ttc" id="aa00623_html_a6d3b35d9362572d24857c0fa2e5354ad"><div class="ttname"><a href="a00623.html#a6d3b35d9362572d24857c0fa2e5354ad">DestroyProcessesClasses</a></div><div class="ttdeci">VOID DestroyProcessesClasses(PPROCESSINFO ppi)</div><div class="ttdef"><b>Definition:</b> <a href="a00623_source.html#l01607">class.c:1607</a></div></div>
<div class="ttc" id="aa00629_html_af323f4c96b1b44349f66293cb7b4dabb"><div class="ttname"><a href="a00629.html#af323f4c96b1b44349f66293cb7b4dabb">gabObjectCreateFlags</a></div><div class="ttdeci">CONST BYTE gabObjectCreateFlags[]</div><div class="ttdef"><b>Definition:</b> <a href="a00695_source.html#l00039">handtabl.c:39</a></div></div>
<div class="ttc" id="aa00824_html_a869d0d6d1e05b9dfc0ad12d8bbc2408e"><div class="ttname"><a href="a00824.html#a869d0d6d1e05b9dfc0ad12d8bbc2408e">_GetInputState</a></div><div class="ttdeci">BOOL _GetInputState(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02901">queue.c:2901</a></div></div>
<div class="ttc" id="aa02889_html_a89857e53108d9b82242fbfb9b7b57dd5"><div class="ttname"><a href="a02889.html#a89857e53108d9b82242fbfb9b7b57dd5">tagTHREADINFO::pstrAppName</a></div><div class="ttdeci">PUNICODE_STRING pstrAppName</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02296">userk.h:2296</a></div></div>
<div class="ttc" id="aa02905_html_a78173b879891f55834e4c01a7193e359"><div class="ttname"><a href="a02905.html#a78173b879891f55834e4c01a7193e359">tagPROCESSINFO::ptiMainThread</a></div><div class="ttdeci">PTHREADINFO ptiMainThread</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02390">userk.h:2390</a></div></div>
<div class="ttc" id="aa02513_html_a6f032dae4131c13bd5080db077f4e158"><div class="ttname"><a href="a02513.html#a6f032dae4131c13bd5080db077f4e158">tagSERVERINFO::nEvents</a></div><div class="ttdeci">int nEvents</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00979">user.h:979</a></div></div>
<div class="ttc" id="aa02649_html_a2fa9e5ed0186fa6f16c046d47f736ef2"><div class="ttname"><a href="a02649.html#a2fa9e5ed0186fa6f16c046d47f736ef2">tagCLIENTTHREADINFO::fsChangeBits</a></div><div class="ttdeci">WORD fsChangeBits</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l02217">user.h:2217</a></div></div>
<div class="ttc" id="aa00800_html_a6f2b9dd1729d23941460a67c73dc1f4e"><div class="ttname"><a href="a00800.html#a6f2b9dd1729d23941460a67c73dc1f4e">xxxCancelTracking</a></div><div class="ttdeci">VOID xxxCancelTracking(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a00800_source.html#l01705">movesize.c:1705</a></div></div>
<div class="ttc" id="aa00821_html_ac17f293887ea0105ad183fc049cd56a1"><div class="ttname"><a href="a00821.html#ac17f293887ea0105ad183fc049cd56a1">UT_FastGetProfileStringW</a></div><div class="ttdeci">UINT UT_FastGetProfileStringW(UINT idSection, LPCWSTR pwszKey, LPCWSTR pwszDefault, LPWSTR pwszReturn, DWORD cch)</div><div class="ttdef"><b>Definition:</b> <a href="a00821_source.html#l00860">profile.c:860</a></div></div>
<div class="ttc" id="aa00737_html_a9a296006325773dbd9cc92a586007c34"><div class="ttname"><a href="a00737.html#a9a296006325773dbd9cc92a586007c34">xxxDoSysExpunge</a></div><div class="ttdeci">VOID xxxDoSysExpunge(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00737_source.html#l00252">libmgmt.c:252</a></div></div>
<div class="ttc" id="aa02801_html_a7e126c1a4f38cc704dd65b5b3cfb0745"><div class="ttname"><a href="a02801.html#a7e126c1a4f38cc704dd65b5b3cfb0745">tagDESKTOP::hheapDesktop</a></div><div class="ttdeci">PVOID hheapDesktop</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01724">userk.h:1724</a></div></div>
<div class="ttc" id="aa00794_html_aa1a0bd0afdbee1ae21b4f429d5e1bee5"><div class="ttname"><a href="a00794.html#aa1a0bd0afdbee1ae21b4f429d5e1bee5">MNEndMenuState</a></div><div class="ttdeci">void MNEndMenuState(BOOL fFreePopup)</div><div class="ttdef"><b>Definition:</b> <a href="a00794_source.html#l00255">mnstate.c:255</a></div></div>
<div class="ttc" id="aa00899_html_a735e711fdfa2ca8337263f6799250a97"><div class="ttname"><a href="a00899.html#a735e711fdfa2ca8337263f6799250a97">xxxSetProcessWindowStation</a></div><div class="ttdeci">BOOL xxxSetProcessWindowStation(HWINSTA)</div><div class="ttdef"><b>Definition:</b> <a href="a00920_source.html#l00723">winsta.c:723</a></div></div>
<div class="ttc" id="aa02857_html_ac13bc459ae800248eabb652b9f6dc8ed"><div class="ttname"><a href="a02857.html#ac13bc459ae800248eabb652b9f6dc8ed">tagQMSG::msg</a></div><div class="ttdeci">MSG msg</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02051">userk.h:2051</a></div></div>
<div class="ttc" id="aa00824_html_a6e0a0685504f087ee37b9165459b305b"><div class="ttname"><a href="a00824.html#a6e0a0685504f087ee37b9165459b305b">STARTF_SCREENSAVER</a></div><div class="ttdeci">#define STARTF_SCREENSAVER</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00904">queue.c:904</a></div></div>
<div class="ttc" id="aa02905_html_a44b5958e6b5534a50ebdf2fe332d8118"><div class="ttname"><a href="a02905.html#a44b5958e6b5534a50ebdf2fe332d8118">tagPROCESSINFO::dwCompatFlags</a></div><div class="ttdeci">DWORD dwCompatFlags</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02403">userk.h:2403</a></div></div>
<div class="ttc" id="aa02637_html_a3982d6da784ea13e37aa03ba23db4df3"><div class="ttname"><a href="a02637.html#a3982d6da784ea13e37aa03ba23db4df3">tagSBTRACK::spwndTrack</a></div><div class="ttdeci">PWND spwndTrack</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l02069">user.h:2069</a></div></div>
<div class="ttc" id="aa02801_html"><div class="ttname"><a href="a02801.html">tagDESKTOP</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01703">userk.h:1703</a></div></div>
<div class="ttc" id="aa02889_html_a600a7e9e5efe8158b113973e9f65b6fa"><div class="ttname"><a href="a02889.html#a600a7e9e5efe8158b113973e9f65b6fa">tagTHREADINFO::cti</a></div><div class="ttdeci">CLIENTTHREADINFO cti</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02281">userk.h:2281</a></div></div>
<div class="ttc" id="aa00881_html_a16f932bda409a22bfb319067daffc1a1"><div class="ttname"><a href="a00881.html#a16f932bda409a22bfb319067daffc1a1">xxxDirectedYield</a></div><div class="ttdeci">void xxxDirectedYield(DWORD dwThreadId)</div><div class="ttdef"><b>Definition:</b> <a href="a00881_source.html#l00672">taskman.c:672</a></div></div>
<div class="ttc" id="aa00638_html_a9f0bf38c04ea2aeebbf17e5f1353ea34"><div class="ttname"><a href="a00638.html#a9f0bf38c04ea2aeebbf17e5f1353ea34">UpdateCursorImage</a></div><div class="ttdeci">VOID UpdateCursorImage(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a00638_source.html#l00483">cursor.c:483</a></div></div>
<div class="ttc" id="aa00824_html_a1310cfa8277987ec1f39ab190577eb4c"><div class="ttname"><a href="a00824.html#a1310cfa8277987ec1f39ab190577eb4c">QUEUE_ENTRIES</a></div><div class="ttdeci">#define QUEUE_ENTRIES</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00051">queue.c:51</a></div></div>
<div class="ttc" id="aa02901_html"><div class="ttname"><a href="a02901.html">tagDESKTOPVIEW</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02376">userk.h:2376</a></div></div>
<div class="ttc" id="aa02889_html_a64da47920250096684c62e566c661139"><div class="ttname"><a href="a02889.html#a64da47920250096684c62e566c661139">tagTHREADINFO::pEventQueueServer</a></div><div class="ttdeci">PKEVENT pEventQueueServer</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02284">userk.h:2284</a></div></div>
<div class="ttc" id="aa00824_html_a6a7fb4f365d4d2e1262f9393629e17be"><div class="ttname"><a href="a00824.html#a6a7fb4f365d4d2e1262f9393629e17be">DestroyProcessInfo</a></div><div class="ttdeci">BOOL DestroyProcessInfo(PW32PROCESS pwp)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03596">queue.c:3596</a></div></div>
<div class="ttc" id="aa00800_html_a57923c8b89fbaf4b400d75e67ad9e2dd"><div class="ttname"><a href="a00800.html#a57923c8b89fbaf4b400d75e67ad9e2dd">xxxCancelTrackingForThread</a></div><div class="ttdeci">VOID xxxCancelTrackingForThread(PTHREADINFO ptiCancel)</div><div class="ttdef"><b>Definition:</b> <a href="a00800_source.html#l01640">movesize.c:1640</a></div></div>
<div class="ttc" id="aa02801_html_a76d4881aa4c15330103e83a80e6b5dc7"><div class="ttname"><a href="a02801.html#a76d4881aa4c15330103e83a80e6b5dc7">tagDESKTOP::pDeskInfo</a></div><div class="ttdeci">PDESKTOPINFO pDeskInfo</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01706">userk.h:1706</a></div></div>
<div class="ttc" id="aa02885_html_a0153e6fcd0d8052211d17aa193efeab0"><div class="ttname"><a href="a02885.html#a0153e6fcd0d8052211d17aa193efeab0">tagMENUSTATE::fInsideMenuLoop</a></div><div class="ttdeci">DWORD fInsideMenuLoop</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02246">userk.h:2246</a></div></div>
<div class="ttc" id="aa00824_html_ac708496b23f104c90d93744009fc5037"><div class="ttname"><a href="a00824.html#ac708496b23f104c90d93744009fc5037">ClearWakeBit</a></div><div class="ttdeci">VOID ClearWakeBit(PTHREADINFO pti, UINT wWakeBit, BOOL fSysCheck)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03390">queue.c:3390</a></div></div>
<div class="ttc" id="aa03257_html_a72d6c69b0eefb30311d982761970b971"><div class="ttname"><a href="a03257.html#a72d6c69b0eefb30311d982761970b971">gptiForeground</a></div><div class="ttdeci">PTHREADINFO gptiForeground</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00131">kernel/globals.c:131</a></div></div>
<div class="ttc" id="aa00881_html_a9cbb6a67b65dbeac7e3d6e52482bd052"><div class="ttname"><a href="a00881.html#a9cbb6a67b65dbeac7e3d6e52482bd052">InsertTask</a></div><div class="ttdeci">void InsertTask(PPROCESSINFO ppi, PTDB ptdbNew)</div><div class="ttdef"><b>Definition:</b> <a href="a00881_source.html#l00060">taskman.c:60</a></div></div>
<div class="ttc" id="aa02801_html_aa5a1d482d42aa7bc00013ae77771910a"><div class="ttname"><a href="a02801.html#aa5a1d482d42aa7bc00013ae77771910a">tagDESKTOP::dwConsoleThreadId</a></div><div class="ttdeci">DWORD dwConsoleThreadId</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01725">userk.h:1725</a></div></div>
<div class="ttc" id="aa03257_html_aaa5057517c2d0fcd47d29d0ab50cc111"><div class="ttname"><a href="a03257.html#aaa5057517c2d0fcd47d29d0ab50cc111">gpqForegroundPrev</a></div><div class="ttdeci">PQ gpqForegroundPrev</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00134">kernel/globals.c:134</a></div></div>
<div class="ttc" id="aa03257_html_ab302ed5096d732e53f944c97b8321ba0"><div class="ttname"><a href="a03257.html#ab302ed5096d732e53f944c97b8321ba0">giheLast</a></div><div class="ttdeci">DWORD giheLast</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00065">kernel/globals.c:65</a></div></div>
<div class="ttc" id="aa02889_html_a4f153f70a2bf0f73f46977b3401a7b7b"><div class="ttname"><a href="a02889.html#a4f153f70a2bf0f73f46977b3401a7b7b">tagTHREADINFO::pqAttach</a></div><div class="ttdeci">struct tagQ * pqAttach</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02327">userk.h:2327</a></div></div>
<div class="ttc" id="aa02869_html_a2b01f3f47a105e7bf6f6196ba5673926"><div class="ttname"><a href="a02869.html#a2b01f3f47a105e7bf6f6196ba5673926">tagQ::QF_flags</a></div><div class="ttdeci">DWORD QF_flags</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02187">userk.h:2187</a></div></div>
<div class="ttc" id="aa00824_html_a3093b6701b169a7a3a6e53937efc850d"><div class="ttname"><a href="a00824.html#a3093b6701b169a7a3a6e53937efc850d">xxxGetInputEvent</a></div><div class="ttdeci">HANDLE xxxGetInputEvent(DWORD dwWakeMask)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03787">queue.c:3787</a></div></div>
<div class="ttc" id="aa03641_html_ab30158d9de22f52e0dbe98db97b94e62"><div class="ttname"><a href="a03641.html#ab30158d9de22f52e0dbe98db97b94e62">CheckPwndFilter</a></div><div class="ttdeci">BOOL CheckPwndFilter(PWND pwnd, PWND pwndFilter)</div><div class="ttdef"><b>Definition:</b> <a href="a03641_source.html#l00100">kernel/random.c:100</a></div></div>
<div class="ttc" id="aa00824_html_a700c756867e191fed7d258edd7e3e536"><div class="ttname"><a href="a00824.html#a700c756867e191fed7d258edd7e3e536">TransferWakeBit</a></div><div class="ttdeci">void TransferWakeBit(PTHREADINFO pti, UINT message)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03339">queue.c:3339</a></div></div>
<div class="ttc" id="aa00824_html_a4aa3b726408152e69f9fd19088883ef4"><div class="ttname"><a href="a00824.html#a4aa3b726408152e69f9fd19088883ef4">WaitOnPseudoEvent</a></div><div class="ttdeci">DWORD WaitOnPseudoEvent(HANDLE *phE, DWORD dwMilliseconds)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l04231">queue.c:4231</a></div></div>
<div class="ttc" id="aa00824_html_af9d1b276723341720a345902e1f14645"><div class="ttname"><a href="a00824.html#af9d1b276723341720a345902e1f14645">StoreMessage</a></div><div class="ttdeci">void StoreMessage(LPMSG pmsg, PWND pwnd, UINT message, DWORD wParam, LONG lParam, DWORD time)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03474">queue.c:3474</a></div></div>
<div class="ttc" id="aa00824_html_a2b2ac38b234d1daf66fd52ba7ddf27fc"><div class="ttname"><a href="a00824.html#a2b2ac38b234d1daf66fd52ba7ddf27fc">SetAppCompatFlags</a></div><div class="ttdeci">void SetAppCompatFlags(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00526">queue.c:526</a></div></div>
<div class="ttc" id="aa02801_html_a2e665ea3941bf02f8d89deaebca7b0e4"><div class="ttname"><a href="a02801.html#a2e665ea3941bf02f8d89deaebca7b0e4">tagDESKTOP::PtiList</a></div><div class="ttdeci">LIST_ENTRY PtiList</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01726">userk.h:1726</a></div></div>
<div class="ttc" id="aa00824_html_a41c36c29c72ea20161333931eaa8302f"><div class="ttname"><a href="a00824.html#a41c36c29c72ea20161333931eaa8302f">CleanEventMessage</a></div><div class="ttdeci">void CleanEventMessage(PQMSG pqmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02129">queue.c:2129</a></div></div>
<div class="ttc" id="aa03257_html_a601e8e85876cb79a58cf5cc3a717236d"><div class="ttname"><a href="a03257.html#a601e8e85876cb79a58cf5cc3a717236d">gtimeStartCursorHide</a></div><div class="ttdeci">DWORD gtimeStartCursorHide</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00475">kernel/globals.c:475</a></div></div>
<div class="ttc" id="aa02809_html_a5734cf57c3cd916ca3c74b17b7c6f39e"><div class="ttname"><a href="a02809.html#a5734cf57c3cd916ca3c74b17b7c6f39e">tagWINDOWSTATION::spwndLogonNotify</a></div><div class="ttdeci">struct tagWND * spwndLogonNotify</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01756">userk.h:1756</a></div></div>
<div class="ttc" id="aa02609_html_af5a2c632fbaf6fbde73f27e29b41e136"><div class="ttname"><a href="a02609.html#af5a2c632fbaf6fbde73f27e29b41e136">tagDESKTOPINFO::idShellProcess</a></div><div class="ttdeci">DWORD idShellProcess</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01607">user.h:1607</a></div></div>
<div class="ttc" id="aa00824_html_a734cea1951ba634070f292cc3ffa68a3"><div class="ttname"><a href="a00824.html#a734cea1951ba634070f292cc3ffa68a3">ConsoleControl</a></div><div class="ttdeci">NTSTATUS ConsoleControl(IN CONSOLECONTROL ConsoleControl, IN PVOID ConsoleInformation, IN ULONG ConsoleInformationLength)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l04703">queue.c:4703</a></div></div>
<div class="ttc" id="aa00824_html_aa91fe5efc8921eb5856bfe012972c2b3"><div class="ttname"><a href="a00824.html#aa91fe5efc8921eb5856bfe012972c2b3">UserSetConsoleProcessWindowStation</a></div><div class="ttdeci">void UserSetConsoleProcessWindowStation(DWORD idProcess, HWINSTA hwinsta)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00251">queue.c:251</a></div></div>
<div class="ttc" id="aa02889_html_a318c1d57c31936937fb02314df457e08"><div class="ttname"><a href="a02889.html#a318c1d57c31936937fb02314df457e08">tagTHREADINFO::ptiSibling</a></div><div class="ttdeci">struct tagTHREADINFO * ptiSibling</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02333">userk.h:2333</a></div></div>
<div class="ttc" id="aa00371_html_a162a73e20dfabca084a3ebb4581631a8"><div class="ttname"><a href="a00371.html#a162a73e20dfabca084a3ebb4581631a8">UserAssert</a></div><div class="ttdeci">#define UserAssert(exp)</div><div class="ttdef"><b>Definition:</b> <a href="a00950_source.html#l00117">usersrv.h:117</a></div></div>
<div class="ttc" id="aa02881_html_aa42e3dbb30b0274b2ccf7b2ccd7fdcad"><div class="ttname"><a href="a02881.html#aa42e3dbb30b0274b2ccf7b2ccd7fdcad">tagTDB::nPriority</a></div><div class="ttdeci">int nPriority</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02233">userk.h:2233</a></div></div>
<div class="ttc" id="aa00371_html_afa5f32de88404289ec03cd2c0e61e94f"><div class="ttname"><a href="a00371.html#afa5f32de88404289ec03cd2c0e61e94f">RIP_ERROR</a></div><div class="ttdeci">#define RIP_ERROR</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00028">winerrp.h:28</a></div></div>
<div class="ttc" id="aa00824_html_acca9241955afe10b5ed2fba6048ed484"><div class="ttname"><a href="a00824.html#acca9241955afe10b5ed2fba6048ed484">QEntryLookasideZone</a></div><div class="ttdeci">ZONE_HEADER QEntryLookasideZone</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00042">queue.c:42</a></div></div>
<div class="ttc" id="aa03257_html_a25f03eea622def9f9059f147118d2dcb"><div class="ttname"><a href="a03257.html#a25f03eea622def9f9059f147118d2dcb">gspklBaseLayout</a></div><div class="ttdeci">PKL gspklBaseLayout</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00212">kernel/globals.c:212</a></div></div>
<div class="ttc" id="aa00824_html_ab986ea03635f8af5bed1d0a48059ad78"><div class="ttname"><a href="a00824.html#ab986ea03635f8af5bed1d0a48059ad78">FindQMsg</a></div><div class="ttdeci">PQMSG FindQMsg(PTHREADINFO pti, PMLIST pml, PWND pwndFilter, UINT msgMin, UINT msgMax)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02437">queue.c:2437</a></div></div>
<div class="ttc" id="aa00638_html_ac0816c73ec6cd096ee9436e038337f80"><div class="ttname"><a href="a00638.html#ac0816c73ec6cd096ee9436e038337f80">_ClipCursor</a></div><div class="ttdeci">BOOL _ClipCursor(LPCRECT prcClip)</div><div class="ttdef"><b>Definition:</b> <a href="a00638_source.html#l00205">cursor.c:205</a></div></div>
<div class="ttc" id="aa02837_html"><div class="ttname"><a href="a02837.html">tagPOPUPMENU</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01880">userk.h:1880</a></div></div>
<div class="ttc" id="aa03629_html"><div class="ttname"><a href="a03629.html">precomp.h</a></div></div>
<div class="ttc" id="aa00371_html_a31aafffb49dfe98bdc749c9b35c90162"><div class="ttname"><a href="a00371.html#a31aafffb49dfe98bdc749c9b35c90162">RIPMSG1</a></div><div class="ttdeci">#define RIPMSG1(flags, szFmt, p1)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00132">winerrp.h:132</a></div></div>
<div class="ttc" id="aa03257_html_ad9f551216ba73947832de96844110fca"><div class="ttname"><a href="a03257.html#ad9f551216ba73947832de96844110fca">grpwinstaList</a></div><div class="ttdeci">PWINDOWSTATION grpwinstaList</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00182">kernel/globals.c:182</a></div></div>
<div class="ttc" id="aa00887_html_a2b58253786e8e91044b7d02483c17c65"><div class="ttname"><a href="a00887.html#a2b58253786e8e91044b7d02483c17c65">DestroyThreadsTimers</a></div><div class="ttdeci">VOID DestroyThreadsTimers(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00887_source.html#l00449">timers.c:449</a></div></div>
<div class="ttc" id="aa03605_html_aa3b0c33e20363be2ffa1cd10a3d54342"><div class="ttname"><a href="a03605.html#aa3b0c33e20363be2ffa1cd10a3d54342">xxxPlayEventSound</a></div><div class="ttdeci">VOID xxxPlayEventSound(LPWSTR lpszwSound)</div><div class="ttdef"><b>Definition:</b> <a href="a03605_source.html#l00164">kernel/msgbeep.c:164</a></div></div>
<div class="ttc" id="aa02881_html_a22132b3713c94f0f3034542da138061d"><div class="ttname"><a href="a02881.html#a22132b3713c94f0f3034542da138061d">tagTDB::ptdbNext</a></div><div class="ttdeci">struct tagTDB * ptdbNext</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02231">userk.h:2231</a></div></div>
<div class="ttc" id="aa02869_html_a1a5a5450f389722e0685dd9da834bfbe"><div class="ttname"><a href="a02869.html#a1a5a5450f389722e0685dd9da834bfbe">tagQ::idSysPeek</a></div><div class="ttdeci">DWORD idSysPeek</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02161">userk.h:2161</a></div></div>
<div class="ttc" id="aa00860_html_a386f0678a4f1a1261f1cfd672696933a"><div class="ttname"><a href="a00860.html#a386f0678a4f1a1261f1cfd672696933a">xxxLockWindowUpdate2</a></div><div class="ttdeci">BOOL xxxLockWindowUpdate2(PWND pwndLock, BOOL fThreadOverride)</div><div class="ttdef"><b>Definition:</b> <a href="a00860_source.html#l00758">spb.c:758</a></div></div>
<div class="ttc" id="aa02889_html_af8fb3a0f2a65257b83edd457a19dca57"><div class="ttname"><a href="a02889.html#af8fb3a0f2a65257b83edd457a19dca57">tagTHREADINFO::ptdb</a></div><div class="ttdeci">PTDB ptdb</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02315">userk.h:2315</a></div></div>
<div class="ttc" id="aa00842_html_a69cf2e14dcefd941469ad5126e40f79a"><div class="ttname"><a href="a00842.html#a69cf2e14dcefd941469ad5126e40f79a">xxxSendMessage</a></div><div class="ttdeci">LONG xxxSendMessage(PWND pwnd, UINT message, DWORD wParam, LONG lParam)</div><div class="ttdef"><b>Definition:</b> <a href="a00842_source.html#l00613">sendmsg.c:613</a></div></div>
<div class="ttc" id="aa00257_html_a8315d2c807ba18ba9e528c40614b6173"><div class="ttname"><a href="a00257.html#a8315d2c807ba18ba9e528c40614b6173">PtiCurrent</a></div><div class="ttdeci">PTHREADINFO PtiCurrent(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a00263_source.html#l00526">winmgrc.c:526</a></div></div>
<div class="ttc" id="aa00695_html_accaefd632c9d99e48d39a96e9b66f2ef"><div class="ttname"><a href="a00695.html#accaefd632c9d99e48d39a96e9b66f2ef">MarkThreadsObjects</a></div><div class="ttdeci">void MarkThreadsObjects(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00695_source.html#l01864">handtabl.c:1864</a></div></div>
<div class="ttc" id="aa02905_html_a2005bba2f650d045ed083841bfeb9648"><div class="ttname"><a href="a02905.html#a2005bba2f650d045ed083841bfeb9648">tagPROCESSINFO::dwhmodLibLoadedMask</a></div><div class="ttdeci">DWORD dwhmodLibLoadedMask</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02397">userk.h:2397</a></div></div>
<div class="ttc" id="aa00824_html_aa8ea52319ca33f5f02b7813e98b5dc40"><div class="ttname"><a href="a00824.html#aa8ea52319ca33f5f02b7813e98b5dc40">TraceDdeMsg</a></div><div class="ttdeci">#define TraceDdeMsg(m, h1, h2, c)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00037">queue.c:37</a></div></div>
<div class="ttc" id="aa00824_html_a51cfc38140186482e8362d7bf1d3aa20"><div class="ttname"><a href="a00824.html#a51cfc38140186482e8362d7bf1d3aa20">FreeQEntry</a></div><div class="ttdeci">void FreeQEntry(PQMSG pqmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02372">queue.c:2372</a></div></div>
<div class="ttc" id="aa00809_html_ae1f04171d74f1a21b487af2a34922aa8"><div class="ttname"><a href="a00809.html#ae1f04171d74f1a21b487af2a34922aa8">apObjects</a></div><div class="ttdeci">PVOID * apObjects</div><div class="ttdef"><b>Definition:</b> <a href="a00809_source.html#l00080">ntinput.c:80</a></div></div>
<div class="ttc" id="aa00824_html_abfd2ef0f8a995e8d2f10f8f0248faf5e"><div class="ttname"><a href="a00824.html#abfd2ef0f8a995e8d2f10f8f0248faf5e">xxxCreateThreadInfo</a></div><div class="ttdeci">NTSTATUS xxxCreateThreadInfo(PW32THREAD W32Thread)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00933">queue.c:933</a></div></div>
<div class="ttc" id="aa02889_html_ad823849cc4fb49252b4941b02841a65f"><div class="ttname"><a href="a02889.html#ad823849cc4fb49252b4941b02841a65f">tagTHREADINFO::pdeskClient</a></div><div class="ttdeci">PDESKTOP pdeskClient</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02317">userk.h:2317</a></div></div>
<div class="ttc" id="aa00899_html_a610540c7d8f62d34a71d42955314f883"><div class="ttname"><a href="a00899.html#a610540c7d8f62d34a71d42955314f883">EnterWowCritSect</a></div><div class="ttdeci">_inline VOID EnterWowCritSect(PTHREADINFO pti, PWOWPROCESSINFO pwpi)</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l03991">userk.h:3991</a></div></div>
<div class="ttc" id="aa00824_html_aed60a33fa725810e80dd0579a0cf4830"><div class="ttname"><a href="a00824.html#aed60a33fa725810e80dd0579a0cf4830">DestroyThreadsMessages</a></div><div class="ttdeci">VOID DestroyThreadsMessages(PQ pq, PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02186">queue.c:2186</a></div></div>
<div class="ttc" id="aa02477_html_a3c194fec8e59a3c52d6c3018cff46ae9"><div class="ttname"><a href="a02477.html#a3c194fec8e59a3c52d6c3018cff46ae9">_CLIENTINFO::hEventQueueClient</a></div><div class="ttdeci">HANDLE hEventQueueClient</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00375">user.h:375</a></div></div>
<div class="ttc" id="aa00824_html_a317b5986c94a0fe6aec5cd38123cf2a3"><div class="ttname"><a href="a00824.html#a317b5986c94a0fe6aec5cd38123cf2a3">SetVDMCursorBounds</a></div><div class="ttdeci">void SetVDMCursorBounds(LPRECT lprc)</div><div class="ttdef"><b>Definition:</b> <a href="a00638_source.html#l00357">cursor.c:357</a></div></div>
<div class="ttc" id="aa00824_html_a43a6d16b48d2a6a3ed35b58340125b68"><div class="ttname"><a href="a00824.html#a43a6d16b48d2a6a3ed35b58340125b68">_GetQueueStatus</a></div><div class="ttdeci">DWORD _GetQueueStatus(UINT flags)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02923">queue.c:2923</a></div></div>
<div class="ttc" id="aa02889_html_a285bd9fb68fc6751850f4171f6e518cd"><div class="ttname"><a href="a02889.html#a285bd9fb68fc6751850f4171f6e518cd">tagTHREADINFO::psiiList</a></div><div class="ttdeci">PSVR_INSTANCE_INFO psiiList</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02320">userk.h:2320</a></div></div>
<div class="ttc" id="aa00824_html_afb5d4ad1a9187731f8d009e2edf71ef4"><div class="ttname"><a href="a00824.html#afb5d4ad1a9187731f8d009e2edf71ef4">QEntryLookasideBase</a></div><div class="ttdeci">PVOID QEntryLookasideBase</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00040">queue.c:40</a></div></div>
<div class="ttc" id="aa00674_html_ac42b3a26d86746846b51a69d11fc0797"><div class="ttname"><a href="a00674.html#ac42b3a26d86746846b51a69d11fc0797">FreeHwndList</a></div><div class="ttdeci">void FreeHwndList(PBWL pbwl)</div><div class="ttdef"><b>Definition:</b> <a href="a00674_source.html#l00340">enumwin.c:340</a></div></div>
<div class="ttc" id="aa02889_html_a215417492fadc11678c689da2447f02e"><div class="ttname"><a href="a02889.html#a215417492fadc11678c689da2447f02e">tagTHREADINFO::ppi</a></div><div class="ttdeci">struct tagPROCESSINFO * ppi</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02271">userk.h:2271</a></div></div>
<div class="ttc" id="aa00686_html_ac02cf9f8e2879a07c57e42ef8f4ff885"><div class="ttname"><a href="a00686.html#ac02cf9f8e2879a07c57e42ef8f4ff885">SetForegroundPriority</a></div><div class="ttdeci">VOID SetForegroundPriority(PTHREADINFO pti, BOOL fSetForeground)</div><div class="ttdef"><b>Definition:</b> <a href="a00686_source.html#l02174">focusact.c:2174</a></div></div>
<div class="ttc" id="aa02889_html_af447983c1a621cdfd8ddac2ba3aa8819"><div class="ttname"><a href="a02889.html#af447983c1a621cdfd8ddac2ba3aa8819">tagTHREADINFO::pSBTrack</a></div><div class="ttdeci">PSBTRACK pSBTrack</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02341">userk.h:2341</a></div></div>
<div class="ttc" id="aa00824_html_af4268805cc7bd4c71ad6d661e7a73b61"><div class="ttname"><a href="a00824.html#af4268805cc7bd4c71ad6d661e7a73b61">UserNotifyProcessCreate</a></div><div class="ttdeci">BOOL UserNotifyProcessCreate(DWORD idProcess, DWORD idParentThread, DWORD dwData, DWORD dwFlags)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00292">queue.c:292</a></div></div>
<div class="ttc" id="aa02881_html_a774eeae0f007ae3ea612baf38cd38936"><div class="ttname"><a href="a02881.html#a774eeae0f007ae3ea612baf38cd38936">tagTDB::pti</a></div><div class="ttdeci">PTHREADINFO pti</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02234">userk.h:2234</a></div></div>
<div class="ttc" id="aa02889_html_a0bbd3e277e986d4b745d195215ff7e05"><div class="ttname"><a href="a02889.html#a0bbd3e277e986d4b745d195215ff7e05">tagTHREADINFO::cDeskClient</a></div><div class="ttdeci">USHORT cDeskClient</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02278">userk.h:2278</a></div></div>
<div class="ttc" id="aa02889_html_ad2b39e24db61b348a98aee43f81aac9c"><div class="ttname"><a href="a02889.html#ad2b39e24db61b348a98aee43f81aac9c">tagTHREADINFO::exitCode</a></div><div class="ttdeci">int exitCode</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02307">userk.h:2307</a></div></div>
<div class="ttc" id="aa00881_html_ab1289f19db2055603d5d72ffb7dccc56"><div class="ttname"><a href="a00881.html#ab1289f19db2055603d5d72ffb7dccc56">DestroyTask</a></div><div class="ttdeci">void DestroyTask(PPROCESSINFO ppi, PTHREADINFO ptiToRemove)</div><div class="ttdef"><b>Definition:</b> <a href="a00881_source.html#l00129">taskman.c:129</a></div></div>
<div class="ttc" id="aa02609_html_a009dc3c70977b9fd09afe23eb4232f76"><div class="ttname"><a href="a02609.html#a009dc3c70977b9fd09afe23eb4232f76">tagDESKTOPINFO::spwndProgman</a></div><div class="ttdeci">struct tagWND * spwndProgman</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01610">user.h:1610</a></div></div>
<div class="ttc" id="aa00656_html_ab6156418d7affbd264dcd2f33436a743"><div class="ttname"><a href="a00656.html#ab6156418d7affbd264dcd2f33436a743">xxxResolveDesktop</a></div><div class="ttdeci">HDESK xxxResolveDesktop(HANDLE hProcess, PUNICODE_STRING pstrDesktop, HWINSTA *phwinsta, BOOL fInherit, BOOL *pbShutDown)</div><div class="ttdef"><b>Definition:</b> <a href="a00656_source.html#l03342">desktop.c:3342</a></div></div>
<div class="ttc" id="aa02793_html_a2f8155c1da5bc6033b5fb9682e01fab6"><div class="ttname"><a href="a02793.html#a2f8155c1da5bc6033b5fb9682e01fab6">tagKL::CodePage</a></div><div class="ttdeci">WORD CodePage</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01658">userk.h:1658</a></div></div>
<div class="ttc" id="aa00824_html_a494493f4db0cfc2a67d2e21d05ba4584"><div class="ttname"><a href="a00824.html#a494493f4db0cfc2a67d2e21d05ba4584">xxxSetProcessInitState</a></div><div class="ttdeci">void xxxSetProcessInitState(PEPROCESS Process, DWORD dwFlags)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00128">queue.c:128</a></div></div>
<div class="ttc" id="aa00881_html_a4265fddd1e842410a284d2f4376940f5"><div class="ttname"><a href="a00881.html#a4265fddd1e842410a284d2f4376940f5">WakeWowTask</a></div><div class="ttdeci">VOID WakeWowTask(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00881_source.html#l00030">taskman.c:30</a></div></div>
<div class="ttc" id="aa00824_html_a502bc63b46d63257da536ef1d37a94bd"><div class="ttname"><a href="a00824.html#a502bc63b46d63257da536ef1d37a94bd">QueryInformationThread</a></div><div class="ttdeci">NTSTATUS QueryInformationThread(IN HANDLE hThread, IN USERTHREADINFOCLASS ThreadInfoClass, OUT PVOID ThreadInformation, IN ULONG ThreadInformationLength, OUT PULONG ReturnLength OPTIONAL)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l04269">queue.c:4269</a></div></div>
<div class="ttc" id="aa02885_html_abfc93aac8825e9638c90a2fbb8bca855"><div class="ttname"><a href="a02885.html#abfc93aac8825e9638c90a2fbb8bca855">tagMENUSTATE::pGlobalPopupMenu</a></div><div class="ttdeci">PPOPUPMENU pGlobalPopupMenu</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02243">userk.h:2243</a></div></div>
<div class="ttc" id="aa00686_html_a16558717257c16a685cc2eaf97a67ad3"><div class="ttname"><a href="a00686.html#a16558717257c16a685cc2eaf97a67ad3">xxxSetForegroundWindow2</a></div><div class="ttdeci">BOOL xxxSetForegroundWindow2(PWND pwnd, PTHREADINFO pti, DWORD fFlags)</div><div class="ttdef"><b>Definition:</b> <a href="a00686_source.html#l01045">focusact.c:1045</a></div></div>
<div class="ttc" id="aa03257_html_a9b6418db6c0448790ef82314b1d46088"><div class="ttname"><a href="a03257.html#a9b6418db6c0448790ef82314b1d46088">gatomConsoleClass</a></div><div class="ttdeci">ATOM gatomConsoleClass</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00270">kernel/globals.c:270</a></div></div>
<div class="ttc" id="aa03590_html_a276dfb2dab9aac12e50a66342a9e68e7"><div class="ttname"><a href="a03590.html#a276dfb2dab9aac12e50a66342a9e68e7">xxxMNCloseHierarchy</a></div><div class="ttdeci">void xxxMNCloseHierarchy(PPOPUPMENU ppopupmenu, PMENUSTATE pMenuState)</div><div class="ttdef"><b>Definition:</b> <a href="a03590_source.html#l01313">kernel/menu.c:1313</a></div></div>
<div class="ttc" id="aa00704_html_a690606e81a12bab434ee7754ae13ea48"><div class="ttname"><a href="a00704.html#a690606e81a12bab434ee7754ae13ea48">DestroyThreadsHotKeys</a></div><div class="ttdeci">VOID DestroyThreadsHotKeys()</div><div class="ttdef"><b>Definition:</b> <a href="a00704_source.html#l00072">hotkeys.c:72</a></div></div>
<div class="ttc" id="aa02905_html_a50126c121ac5d62813a93e0a867acc51"><div class="ttname"><a href="a02905.html#a50126c121ac5d62813a93e0a867acc51">tagPROCESSINFO::hdeskStartup</a></div><div class="ttdeci">HDESK hdeskStartup</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02393">userk.h:2393</a></div></div>
<div class="ttc" id="aa00899_html_a039f7fd6f36069ebd5cd93bce4e70751"><div class="ttname"><a href="a00899.html#a039f7fd6f36069ebd5cd93bce4e70751">PASYNCSENDMSG</a></div><div class="ttdeci">struct tagASYNCSENDMSG * PASYNCSENDMSG</div></div>
<div class="ttc" id="aa02477_html_a44b5958e6b5534a50ebdf2fe332d8118"><div class="ttname"><a href="a02477.html#a44b5958e6b5534a50ebdf2fe332d8118">_CLIENTINFO::dwCompatFlags</a></div><div class="ttdeci">DWORD dwCompatFlags</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00377">user.h:377</a></div></div>
<div class="ttc" id="aa02889_html_ac94f44bcce30243b8e6694862ed82bf7"><div class="ttname"><a href="a02889.html#ac94f44bcce30243b8e6694862ed82bf7">tagTHREADINFO::hklPrev</a></div><div class="ttdeci">HKL hklPrev</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02346">userk.h:2346</a></div></div>
<div class="ttc" id="aa02609_html_a90cb8c3bf2c119d721de439c1e18733b"><div class="ttname"><a href="a02609.html#a90cb8c3bf2c119d721de439c1e18733b">tagDESKTOPINFO::asphkStart</a></div><div class="ttdeci">struct tagHOOK * asphkStart[CWINHOOKS]</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01605">user.h:1605</a></div></div>
<div class="ttc" id="aa00371_html_ae61d954062a9ece52e350e54cad9a23d"><div class="ttname"><a href="a00371.html#ae61d954062a9ece52e350e54cad9a23d">RIPERR0</a></div><div class="ttdeci">#define RIPERR0(idErr, flags, szFmt)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00119">winerrp.h:119</a></div></div>
<div class="ttc" id="aa00257_html_a933a4a4818762a03428fe021dd9772a4"><div class="ttname"><a href="a00257.html#a933a4a4818762a03428fe021dd9772a4">_PostMessage</a></div><div class="ttdeci">BOOL _PostMessage(HWND hwnd, UINT msg, DWORD wParam, LONG lParam, BOOL bAnsi)</div></div>
<div class="ttc" id="aa02477_html_a79413d59e46650132a5add64bfd87791"><div class="ttname"><a href="a02477.html#a79413d59e46650132a5add64bfd87791">_CLIENTINFO::cSpins</a></div><div class="ttdeci">DWORD cSpins</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00374">user.h:374</a></div></div>
<div class="ttc" id="aa02905_html_a8c47e61ad8490b0e1589fce16938e69f"><div class="ttname"><a href="a02905.html#a8c47e61ad8490b0e1589fce16938e69f">tagPROCESSINFO::cSysExpunge</a></div><div class="ttdeci">UINT cSysExpunge</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02396">userk.h:2396</a></div></div>
<div class="ttc" id="aa00899_html_a2b8978b733286dd03b48e8d53510e505"><div class="ttname"><a href="a00899.html#a2b8978b733286dd03b48e8d53510e505">QMSG</a></div><div class="ttdeci">struct tagQMSG QMSG</div></div>
<div class="ttc" id="aa02905_html_a8dec25df4d4163bb209f9f8c1bc70d45"><div class="ttname"><a href="a02905.html#a8dec25df4d4163bb209f9f8c1bc70d45">tagPROCESSINFO::ptiList</a></div><div class="ttdeci">PTHREADINFO ptiList</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02406">userk.h:2406</a></div></div>
<div class="ttc" id="aa00824_html_a47a035d82bebe9c286c31ee6f165d89c"><div class="ttname"><a href="a00824.html#a47a035d82bebe9c286c31ee6f165d89c">CheckQuitMessage</a></div><div class="ttdeci">BOOL CheckQuitMessage(PTHREADINFO pti, LPMSG lpMsg, BOOL fRemoveMsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02518">queue.c:2518</a></div></div>
<div class="ttc" id="aa02869_html_a06d8cdda46761be0d0209f22f5396c50"><div class="ttname"><a href="a02869.html#a06d8cdda46761be0d0209f22f5396c50">tagQ::ptiKeyboard</a></div><div class="ttdeci">PTHREADINFO ptiKeyboard</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02164">userk.h:2164</a></div></div>
<div class="ttc" id="aa00824_html_a08d4b3aa2685ab73b79068f1b572a57a"><div class="ttname"><a href="a00824.html#a08d4b3aa2685ab73b79068f1b572a57a">xxxInitTask</a></div><div class="ttdeci">NTSTATUS xxxInitTask(UINT dwExpWinVer, PUNICODE_STRING pstrAppName, DWORD hTaskWow, DWORD dwHotkey, DWORD idTask, DWORD dwX, DWORD dwY, DWORD dwXSize, DWORD dwYSize, WORD wUnusedAndAvailable)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00658">queue.c:658</a></div></div>
<div class="ttc" id="aa02877_html_afb9b6a62420feb835630dae9263ba014"><div class="ttname"><a href="a02877.html#afb9b6a62420feb835630dae9263ba014">tagWOWTHREADINFO::pIdleEvent</a></div><div class="ttdeci">PKEVENT pIdleEvent</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02224">userk.h:2224</a></div></div>
<div class="ttc" id="aa02881_html_aeabb91a1bd6171bbe97ebb98b926ec63"><div class="ttname"><a href="a02881.html#aeabb91a1bd6171bbe97ebb98b926ec63">tagTDB::hTaskWow</a></div><div class="ttdeci">DWORD hTaskWow</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02236">userk.h:2236</a></div></div>
<div class="ttc" id="aa00020_html_ac02f0141c423acd033ecdd2a757a3cc1"><div class="ttname"><a href="a00020.html#ac02f0141c423acd033ecdd2a757a3cc1">gSharedInfo</a></div><div class="ttdeci">SHAREDINFO gSharedInfo</div><div class="ttdef"><b>Definition:</b> <a href="a00020_source.html#l00040">clglobal.c:40</a></div></div>
<div class="ttc" id="aa00719_html_aede6de42e849405c86466f41e45e6fbd"><div class="ttname"><a href="a00719.html#aede6de42e849405c86466f41e45e6fbd">LW_RegisterWindows</a></div><div class="ttdeci">VOID LW_RegisterWindows(BOOL fSystem)</div><div class="ttdef"><b>Definition:</b> <a href="a00719_source.html#l01070">init.c:1070</a></div></div>
<div class="ttc" id="aa03257_html_a7a841563d95fb37851ffe2fd252b4384"><div class="ttname"><a href="a03257.html#a7a841563d95fb37851ffe2fd252b4384">gpwtiFirst</a></div><div class="ttdeci">PWOWTHREADINFO gpwtiFirst</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00141">kernel/globals.c:141</a></div></div>
<div class="ttc" id="aa02809_html"><div class="ttname"><a href="a02809.html">tagWINDOWSTATION</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01744">userk.h:1744</a></div></div>
<div class="ttc" id="aa02889_html_af11214ca8a85a19dc241374ddc2d4824"><div class="ttname"><a href="a02889.html#af11214ca8a85a19dc241374ddc2d4824">tagTHREADINFO::pClientInfo</a></div><div class="ttdeci">PCLIENTINFO pClientInfo</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02292">userk.h:2292</a></div></div>
<div class="ttc" id="aa03257_html_ab5d3fc70bd0d75f9990788219356470e"><div class="ttname"><a href="a03257.html#ab5d3fc70bd0d75f9990788219356470e">pbwlList</a></div><div class="ttdeci">PBWL pbwlList</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00485">kernel/globals.c:485</a></div></div>
<div class="ttc" id="aa03257_html_a0358e1b51ee64a8ac724d12f71ab14a5"><div class="ttname"><a href="a03257.html#a0358e1b51ee64a8ac724d12f71ab14a5">gpai</a></div><div class="ttdeci">PATTACHINFO gpai</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00044">kernel/globals.c:44</a></div></div>
<div class="ttc" id="aa02781_html_ad850b4a870bf162d1807c31eb8353d0b"><div class="ttname"><a href="a02781.html#ad850b4a870bf162d1807c31eb8353d0b">tagUSERSTARTUPINFO::dwXSize</a></div><div class="ttdeci">DWORD dwXSize</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01615">userk.h:1615</a></div></div>
<div class="ttc" id="aa00824_html_a5f4680255099c975e7786c45b1124304"><div class="ttname"><a href="a00824.html#a5f4680255099c975e7786c45b1124304">QueueFreeList</a></div><div class="ttdeci">PQ QueueFreeList[QUEUE_ENTRIES]</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00052">queue.c:52</a></div></div>
<div class="ttc" id="aa00824_html_a64cd90ffb9f46c279af3c106dc2be4d9"><div class="ttname"><a href="a00824.html#a64cd90ffb9f46c279af3c106dc2be4d9">xxxWaitForInputIdle</a></div><div class="ttdeci">DWORD xxxWaitForInputIdle(DWORD idProcess, DWORD dwMilliseconds, BOOL fSharedWow)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03863">queue.c:3863</a></div></div>
<div class="ttc" id="aa03257_html_abb2b4057bfd76cc925ae845dbb8c8390"><div class="ttname"><a href="a03257.html#abb2b4057bfd76cc925ae845dbb8c8390">gpdeskRecalcQueueAttach</a></div><div class="ttdeci">PDESKTOP gpdeskRecalcQueueAttach</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00059">kernel/globals.c:59</a></div></div>
<div class="ttc" id="aa02861_html_a68937d60a6f49b7a8431db62b38ea721"><div class="ttname"><a href="a02861.html#a68937d60a6f49b7a8431db62b38ea721">_MOVESIZEDATA::spwnd</a></div><div class="ttdeci">struct tagWND * spwnd</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02081">userk.h:2081</a></div></div>
<div class="ttc" id="aa00824_html_a507668fdd19718f6de8825719bf23632"><div class="ttname"><a href="a00824.html#a507668fdd19718f6de8825719bf23632">UserNotifyConsoleApplication</a></div><div class="ttdeci">void UserNotifyConsoleApplication(DWORD idProcess)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00216">queue.c:216</a></div></div>
<div class="ttc" id="aa00365_html_a383740f6dc1129f6127ab14fbe6b607c"><div class="ttname"><a href="a00365.html#a383740f6dc1129f6127ab14fbe6b607c">RtlGetExpWinVer</a></div><div class="ttdeci">DWORD RtlGetExpWinVer(HANDLE hmod)</div><div class="ttdef"><b>Definition:</b> <a href="a03650_source.html#l00028">rtl/random.c:28</a></div></div>
<div class="ttc" id="aa02801_html_a3f38a65f805623b272c560a777329069"><div class="ttname"><a href="a02801.html#a3f38a65f805623b272c560a777329069">tagDESKTOP::dwDTFlags</a></div><div class="ttdeci">DWORD dwDTFlags</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01712">userk.h:1712</a></div></div>
<div class="ttc" id="aa02869_html_a97845e5f321fb758821ac99bd53840de"><div class="ttname"><a href="a02869.html#a97845e5f321fb758821ac99bd53840de">tagQ::iCursorLevel</a></div><div class="ttdeci">int iCursorLevel</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02185">userk.h:2185</a></div></div>
<div class="ttc" id="aa02905_html_a12f7bfd1b0c792cec2292a87a75bc8c5"><div class="ttname"><a href="a02905.html#a12f7bfd1b0c792cec2292a87a75bc8c5">tagPROCESSINFO::usi</a></div><div class="ttdeci">USERSTARTUPINFO usi</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02402">userk.h:2402</a></div></div>
<div class="ttc" id="aa02897_html_a83e6f4dd67deb5f5db5682a4a565d5a3"><div class="ttname"><a href="a02897.html#a83e6f4dd67deb5f5db5682a4a565d5a3">tagWOWPROCESSINFO::lpfnWowExitTask</a></div><div class="ttdeci">DWORD lpfnWowExitTask</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02367">userk.h:2367</a></div></div>
<div class="ttc" id="aa02881_html_a6f032dae4131c13bd5080db077f4e158"><div class="ttname"><a href="a02881.html#a6f032dae4131c13bd5080db077f4e158">tagTDB::nEvents</a></div><div class="ttdeci">int nEvents</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02232">userk.h:2232</a></div></div>
<div class="ttc" id="aa02809_html_a4d2f405b1141000eb2af256e0fc8b98b"><div class="ttname"><a href="a02809.html#a4d2f405b1141000eb2af256e0fc8b98b">tagWINDOWSTATION::dwFlags</a></div><div class="ttdeci">DWORD dwFlags</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01758">userk.h:1758</a></div></div>
<div class="ttc" id="aa00563_html_a074685e97e89d6aa2accdfcb82328699"><div class="ttname"><a href="a00563.html#a074685e97e89d6aa2accdfcb82328699">DWORD</a></div><div class="ttdeci">ddeml v[i&lt; inst &gt;][t&lt; type &gt;][hObj|pObj] Dump DDEML state information ddeml lists all ddeml instances for this process n ddeml t&lt; type &gt; lists all ddeml objects of the given type n n assumes link is first DWORD</div><div class="ttdef"><b>Definition:</b> <a href="a00563_source.html#l00175">exts.h:175</a></div></div>
<div class="ttc" id="aa02865_html_adcf976c068271034e6e569ce3109eb07"><div class="ttname"><a href="a02865.html#adcf976c068271034e6e569ce3109eb07">tagMLIST::cMsgs</a></div><div class="ttdeci">DWORD cMsgs</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02150">userk.h:2150</a></div></div>
<div class="ttc" id="aa00680_html_a481c734b3eea8139a042653549741891"><div class="ttname"><a href="a00680.html#a481c734b3eea8139a042653549741891">ProtectHandle</a></div><div class="ttdeci">NTSTATUS ProtectHandle(IN HANDLE Handle, IN BOOLEAN Protect)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00591">ex.c:591</a></div></div>
<div class="ttc" id="aa00824_html_ae06ed5fecef73835af8f31f5ae4d9b21"><div class="ttname"><a href="a00824.html#ae06ed5fecef73835af8f31f5ae4d9b21">DestroyProcessesObjects</a></div><div class="ttdeci">VOID DestroyProcessesObjects(PPROCESSINFO ppi)</div><div class="ttdef"><b>Definition:</b> <a href="a00695_source.html#l01809">handtabl.c:1809</a></div></div>
<div class="ttc" id="aa03290_html_a67abc9d7678097e0d7225e4af7f7973d"><div class="ttname"><a href="a03290.html#a67abc9d7678097e0d7225e4af7f7973d">SetFMouseMoved</a></div><div class="ttdeci">VOID SetFMouseMoved(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l01213">kernel/input.c:1213</a></div></div>
<div class="ttc" id="aa02889_html_aab41ffe1ce08bf84e59f07b0318b22d7"><div class="ttname"><a href="a02889.html#aab41ffe1ce08bf84e59f07b0318b22d7">tagTHREADINFO::ptl</a></div><div class="ttdeci">PTL ptl</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02266">userk.h:2266</a></div></div>
<div class="ttc" id="aa00680_html_a66df221fdc6a2befeaf8552ff54ab590"><div class="ttname"><a href="a00680.html#a66df221fdc6a2befeaf8552ff54ab590">ThreadUnlockObject</a></div><div class="ttdeci">VOID ThreadUnlockObject(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00547">ex.c:547</a></div></div>
<div class="ttc" id="aa00707_html_a47795b53cdc961798b5310ea5b01456b"><div class="ttname"><a href="a00707.html#a47795b53cdc961798b5310ea5b01456b">FHungApp</a></div><div class="ttdeci">BOOL FHungApp(PTHREADINFO pti, DWORD dwTimeFromLastRead)</div><div class="ttdef"><b>Definition:</b> <a href="a00707_source.html#l00130">hungapp.c:130</a></div></div>
<div class="ttc" id="aa03257_html_a3eabb6cc6d3b24f411b7f94f5d6edac6"><div class="ttname"><a href="a03257.html#a3eabb6cc6d3b24f411b7f94f5d6edac6">gpepCSRSS</a></div><div class="ttdeci">PEPROCESS gpepCSRSS</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00185">kernel/globals.c:185</a></div></div>
<div class="ttc" id="aa00824_html_a44b46f3a89833f8c52a823637e5f5021"><div class="ttname"><a href="a00824.html#a44b46f3a89833f8c52a823637e5f5021">AllocQueue</a></div><div class="ttdeci">PQ AllocQueue(PTHREADINFO ptiKeyState, PQ pq)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l01399">queue.c:1399</a></div></div>
<div class="ttc" id="aa02913_html"><div class="ttname"><a href="a02913.html">tagBWL</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02493">userk.h:2493</a></div></div>
<div class="ttc" id="aa03257_html_a5bcbaef1c421c1998d7ea053444e3fc2"><div class="ttname"><a href="a03257.html#a5bcbaef1c421c1998d7ea053444e3fc2">gpepSystem</a></div><div class="ttdeci">PEPROCESS gpepSystem</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00184">kernel/globals.c:184</a></div></div>
<div class="ttc" id="aa00824_html_ae98d2a9cd72776c2a573809d347a8366"><div class="ttname"><a href="a00824.html#ae98d2a9cd72776c2a573809d347a8366">xxxProcessEventMessage</a></div><div class="ttdeci">VOID xxxProcessEventMessage(PTHREADINFO pti, PQMSG pqmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02682">queue.c:2682</a></div></div>
<div class="ttc" id="aa02781_html_a4d2f405b1141000eb2af256e0fc8b98b"><div class="ttname"><a href="a02781.html#a4d2f405b1141000eb2af256e0fc8b98b">tagUSERSTARTUPINFO::dwFlags</a></div><div class="ttdeci">DWORD dwFlags</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01617">userk.h:1617</a></div></div>
<div class="ttc" id="aa00824_html_a41bf5ee671d1979f26435f9c5e6eb7c3"><div class="ttname"><a href="a00824.html#a41bf5ee671d1979f26435f9c5e6eb7c3">xxxReadPostMessage</a></div><div class="ttdeci">BOOL xxxReadPostMessage(PTHREADINFO pti, LPMSG lpMsg, PWND pwndFilter, UINT msgMin, UINT msgMax, BOOL fRemoveMsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02551">queue.c:2551</a></div></div>
<div class="ttc" id="aa01881_html"><div class="ttname"><a href="a01881.html">_TL</a></div><div class="ttdef"><b>Definition:</b> <a href="a00257_source.html#l00347">usercli.h:347</a></div></div>
<div class="ttc" id="aa02905_html_a23531249739cdcf88f4894d22d409273"><div class="ttname"><a href="a02905.html#a23531249739cdcf88f4894d22d409273">tagPROCESSINFO::pwpi</a></div><div class="ttdeci">PWOWPROCESSINFO pwpi</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02405">userk.h:2405</a></div></div>
<div class="ttc" id="aa00680_html_a4e651db6bc5a53270aaa9886e26de7c4"><div class="ttname"><a href="a00680.html#a4e651db6bc5a53270aaa9886e26de7c4">ThreadLockObject</a></div><div class="ttdeci">VOID ThreadLockObject(PTHREADINFO pti, PVOID pobj, PTL ptl)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00489">ex.c:489</a></div></div>
<div class="ttc" id="aa00824_html_acbf7182e6530b750eed27ef83e03c85f"><div class="ttname"><a href="a00824.html#acbf7182e6530b750eed27ef83e03c85f">CheckProcessForeground</a></div><div class="ttdeci">void CheckProcessForeground(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l00172">kernel/input.c:172</a></div></div>
<div class="ttc" id="aa02905_html_af2dee2144e1b1c252aefa41fb6a2dc37"><div class="ttname"><a href="a02905.html#af2dee2144e1b1c252aefa41fb6a2dc37">tagPROCESSINFO::dwHotkey</a></div><div class="ttdeci">DWORD dwHotkey</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02404">userk.h:2404</a></div></div>
<div class="ttc" id="aa03257_html_acdbf053b054e159961f2ba3d6e577bfc"><div class="ttname"><a href="a03257.html#acdbf053b054e159961f2ba3d6e577bfc">gfAllowForegroundActivate</a></div><div class="ttdeci">BOOL gfAllowForegroundActivate</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00060">kernel/globals.c:60</a></div></div>
<div class="ttc" id="aa02881_html"><div class="ttname"><a href="a02881.html">tagTDB</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02230">userk.h:2230</a></div></div>
<div class="ttc" id="aa00824_html_aba79315d5a06e7686b253fc75d47985b"><div class="ttname"><a href="a00824.html#aba79315d5a06e7686b253fc75d47985b">QUERY_VALUE_BUFFER</a></div><div class="ttdeci">#define QUERY_VALUE_BUFFER</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00516">queue.c:516</a></div></div>
<div class="ttc" id="aa02781_html"><div class="ttname"><a href="a02781.html">tagUSERSTARTUPINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01611">userk.h:1611</a></div></div>
<div class="ttc" id="aa02889_html_a1f6c6f6552be63e92bb242568771ee14"><div class="ttname"><a href="a02889.html#a1f6c6f6552be63e92bb242568771ee14">tagTHREADINFO::pmsd</a></div><div class="ttdeci">PMOVESIZEDATA pmsd</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02335">userk.h:2335</a></div></div>
<div class="ttc" id="aa02581_html"><div class="ttname"><a href="a02581.html">tagWND</a></div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01388">user.h:1388</a></div></div>
<div class="ttc" id="aa00824_html_a85b93c8ee73cb5dc4eb0e7b3221a454a"><div class="ttname"><a href="a00824.html#a85b93c8ee73cb5dc4eb0e7b3221a454a">ScreenSaverCheck</a></div><div class="ttdeci">void ScreenSaverCheck(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l03135">kernel/input.c:3135</a></div></div>
<div class="ttc" id="aa02869_html_ab34627c4e06a3d5e23b559df878ba497"><div class="ttname"><a href="a02869.html#ab34627c4e06a3d5e23b559df878ba497">tagQ::afKeyState</a></div><div class="ttdeci">BYTE afKeyState[CBKEYSTATE]</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02178">userk.h:2178</a></div></div>
<div class="ttc" id="aa02609_html_a313ccee64c6b84cf38149cd97f7e4442"><div class="ttname"><a href="a02609.html#a313ccee64c6b84cf38149cd97f7e4442">tagDESKTOPINFO::fsHooks</a></div><div class="ttdeci">DWORD fsHooks</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01604">user.h:1604</a></div></div>
<div class="ttc" id="aa03257_html_a01d6b23c241a057b5e276bc3095a01eb"><div class="ttname"><a href="a03257.html#a01d6b23c241a057b5e276bc3095a01eb">gpqForeground</a></div><div class="ttdeci">PQ gpqForeground</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00133">kernel/globals.c:133</a></div></div>
<div class="ttc" id="aa02917_html_a774eeae0f007ae3ea612baf38cd38936"><div class="ttname"><a href="a02917.html#a774eeae0f007ae3ea612baf38cd38936">tagHARDERRORHANDLER::pti</a></div><div class="ttdeci">PTHREADINFO pti</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02515">userk.h:2515</a></div></div>
<div class="ttc" id="aa00647_html_a6f12136fa17bb8e8d480fecd7431a391"><div class="ttname"><a href="a00647.html#a6f12136fa17bb8e8d480fecd7431a391">xxxDestroyThreadDDEObject</a></div><div class="ttdeci">VOID xxxDestroyThreadDDEObject(PTHREADINFO pti, PSVR_INSTANCE_INFO psii)</div><div class="ttdef"><b>Definition:</b> <a href="a00647_source.html#l00127">ddemlsvr.c:127</a></div></div>
<div class="ttc" id="aa00851_html_ae82e6ab5253cf5a51f5e270f6b83ccb7"><div class="ttname"><a href="a00851.html#ae82e6ab5253cf5a51f5e270f6b83ccb7">xxxShowWindow</a></div><div class="ttdeci">BOOL xxxShowWindow(PWND pwnd, DWORD cmdShowAnimate)</div><div class="ttdef"><b>Definition:</b> <a href="a00851_source.html#l00081">showwin.c:81</a></div></div>
<div class="ttc" id="aa00824_html_a08b7806fdd50cc30030d391686fbce53"><div class="ttname"><a href="a00824.html#a08b7806fdd50cc30030d391686fbce53">QEntryLookasideBounds</a></div><div class="ttdeci">PVOID QEntryLookasideBounds</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00041">queue.c:41</a></div></div>
<div class="ttc" id="aa00656_html_a0a50756aedb803f4cf70af680806c045"><div class="ttname"><a href="a00656.html#a0a50756aedb803f4cf70af680806c045">xxxSwitchDesktop</a></div><div class="ttdeci">BOOL xxxSwitchDesktop(PWINDOWSTATION pwinsta, PDESKTOP pdesk, BOOL bCreateNew)</div><div class="ttdef"><b>Definition:</b> <a href="a00656_source.html#l02349">desktop.c:2349</a></div></div>
<div class="ttc" id="aa00365_html_ae89734b83f845f738d3f062ea7410a54"><div class="ttname"><a href="a00365.html#ae89734b83f845f738d3f062ea7410a54">PCLIENTINFO</a></div><div class="ttdeci">struct _CLIENTINFO * PCLIENTINFO</div></div>
<div class="ttc" id="aa00824_html_abd2ad2672e1d5b70b9884ce7faeab2a5"><div class="ttname"><a href="a00824.html#abd2ad2672e1d5b70b9884ce7faeab2a5">NORMAL_PRIORITY_TASK</a></div><div class="ttdeci">#define NORMAL_PRIORITY_TASK</div></div>
<div class="ttc" id="aa02869_html_aa187e19d8d7e6018ddfbe3aaa9156240"><div class="ttname"><a href="a02869.html#aa187e19d8d7e6018ddfbe3aaa9156240">tagQ::spwndFocus</a></div><div class="ttdeci">PWND spwndFocus</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02167">userk.h:2167</a></div></div>
<div class="ttc" id="aa00824_html_a33338ab17ca4eb073cf36ecc1ae32435"><div class="ttname"><a href="a00824.html#a33338ab17ca4eb073cf36ecc1ae32435">AllocQEntry</a></div><div class="ttdeci">PQMSG AllocQEntry(PMLIST pml)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02258">queue.c:2258</a></div></div>
<div class="ttc" id="aa00899_html_ab15c206d3faba2643713e9bcaa9f987b"><div class="ttname"><a href="a00899.html#ab15c206d3faba2643713e9bcaa9f987b">ClientDeliverUserApc</a></div><div class="ttdeci">VOID ClientDeliverUserApc(VOID)</div></div>
<div class="ttc" id="aa02905_html_a1899acfa354d8b3a6a8e69f7a1f781af"><div class="ttname"><a href="a02905.html#a1899acfa354d8b3a6a8e69f7a1f781af">tagPROCESSINFO::rpwinsta</a></div><div class="ttdeci">struct tagWINDOWSTATION * rpwinsta</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02399">userk.h:2399</a></div></div>
<div class="ttc" id="aa02889_html_a46e17f3cb4ad052b2236c1d9987111b6"><div class="ttname"><a href="a02889.html#a46e17f3cb4ad052b2236c1d9987111b6">tagTHREADINFO::PtiLink</a></div><div class="ttdeci">LIST_ENTRY PtiLink</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02265">userk.h:2265</a></div></div>
<div class="ttc" id="aa00686_html_a1dc7b5d2bcb53d6272a655ff64427cb3"><div class="ttname"><a href="a00686.html#a1dc7b5d2bcb53d6272a655ff64427cb3">xxxActivateThisWindow</a></div><div class="ttdeci">BOOL xxxActivateThisWindow(PWND pwnd, DWORD tidLoseForeground, DWORD fFlags)</div><div class="ttdef"><b>Definition:</b> <a href="a00686_source.html#l00430">focusact.c:430</a></div></div>
<div class="ttc" id="aa02913_html_a3a1eb7a0fa3eacbfe24214c5b7eb8db8"><div class="ttname"><a href="a02913.html#a3a1eb7a0fa3eacbfe24214c5b7eb8db8">tagBWL::pbwlNext</a></div><div class="ttdeci">struct tagBWL * pbwlNext</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02494">userk.h:2494</a></div></div>
<div class="ttc" id="aa03257_html_a698fb4f9e9622f12d1056e2fdbf47cae"><div class="ttname"><a href="a03257.html#a698fb4f9e9622f12d1056e2fdbf47cae">gptiTasklist</a></div><div class="ttdeci">PTHREADINFO gptiTasklist</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00128">kernel/globals.c:128</a></div></div>
<div class="ttc" id="aa02889_html_a97845e5f321fb758821ac99bd53840de"><div class="ttname"><a href="a02889.html#a97845e5f321fb758821ac99bd53840de">tagTHREADINFO::iCursorLevel</a></div><div class="ttdeci">int iCursorLevel</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02330">userk.h:2330</a></div></div>
<div class="ttc" id="aa02869_html_a9c78a46a532787c63a126570d8a56680"><div class="ttname"><a href="a02869.html#a9c78a46a532787c63a126570d8a56680">tagQ::ptiSysLock</a></div><div class="ttdeci">PTHREADINFO ptiSysLock</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02159">userk.h:2159</a></div></div>
<div class="ttc" id="aa03290_html_a51ccaa0d03e99d3be71c4ac54a262154"><div class="ttname"><a href="a03290.html#a51ccaa0d03e99d3be71c4ac54a262154">SleepInputIdle</a></div><div class="ttdeci">void SleepInputIdle(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l04959">kernel/input.c:4959</a></div></div>
<div class="ttc" id="aa02905_html"><div class="ttname"><a href="a02905.html">tagPROCESSINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02386">userk.h:2386</a></div></div>
<div class="ttc" id="aa02905_html_a28c079cebbf5a70cee9aea1d83dbd239"><div class="ttname"><a href="a02905.html#a28c079cebbf5a70cee9aea1d83dbd239">tagPROCESSINFO::rpdeskStartup</a></div><div class="ttdeci">PDESKTOP rpdeskStartup</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02392">userk.h:2392</a></div></div>
<div class="ttc" id="aa00371_html_a41f433389f20db57f042022a662e96de"><div class="ttname"><a href="a00371.html#a41f433389f20db57f042022a662e96de">RIP_WARNING</a></div><div class="ttdeci">#define RIP_WARNING</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00029">winerrp.h:29</a></div></div>
<div class="ttc" id="aa00824_html_a7a86c4e19f6b63c35d8b33b891a400c9"><div class="ttname"><a href="a00824.html#a7a86c4e19f6b63c35d8b33b891a400c9">FreeMessageList</a></div><div class="ttdeci">VOID FreeMessageList(PMLIST pml)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02164">queue.c:2164</a></div></div>
<div class="ttc" id="aa00824_html_a7255c4dd66972cb39b71e2c8835bd3f2"><div class="ttname"><a href="a00824.html#a7255c4dd66972cb39b71e2c8835bd3f2">QS_TEST_AND_CLEAR</a></div><div class="ttdeci">#define QS_TEST_AND_CLEAR</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02898">queue.c:2898</a></div></div>
<div class="ttc" id="aa02869_html_ade15a80896abdba1533b909440c29699"><div class="ttname"><a href="a02869.html#ade15a80896abdba1533b909440c29699">tagQ::caret</a></div><div class="ttdeci">CARET caret</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02182">userk.h:2182</a></div></div>
<div class="ttc" id="aa02781_html_ab0197bf9bedcf5ad7f21808dd143e7b2"><div class="ttname"><a href="a02781.html#ab0197bf9bedcf5ad7f21808dd143e7b2">tagUSERSTARTUPINFO::wShowWindow</a></div><div class="ttdeci">WORD wShowWindow</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01618">userk.h:1618</a></div></div>
<div class="ttc" id="aa00815_html_ac2b66e10f5ca99676b77a368c7612687"><div class="ttname"><a href="a00815.html#ac2b66e10f5ca99676b77a368c7612687">xxxFlushPalette</a></div><div class="ttdeci">VOID xxxFlushPalette(PWND pwnd)</div><div class="ttdef"><b>Definition:</b> <a href="a00815_source.html#l00237">palette.c:237</a></div></div>
<div class="ttc" id="aa03257_html_a50563c6c979ad91669e08b094dcc0731"><div class="ttname"><a href="a03257.html#a50563c6c979ad91669e08b094dcc0731">guiActivateShellWindow</a></div><div class="ttdeci">UINT guiActivateShellWindow</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00072">kernel/globals.c:72</a></div></div>
<div class="ttc" id="aa00824_html_a38b809c615e10eca863b213d461e7040"><div class="ttname"><a href="a00824.html#a38b809c615e10eca863b213d461e7040">CalcStartCursorHide</a></div><div class="ttdeci">void CalcStartCursorHide(PW32PROCESS pwp, DWORD timeAdd)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00431">queue.c:431</a></div></div>
<div class="ttc" id="aa02837_html_a25e12f5244026df0821311337b73c3e9"><div class="ttname"><a href="a02837.html#a25e12f5244026df0821311337b73c3e9">tagPOPUPMENU::fIsMenuBar</a></div><div class="ttdeci">DWORD fIsMenuBar</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01883">userk.h:1883</a></div></div>
<div class="ttc" id="aa00824_html_ada31cc49cd6c9b760343ae21f7fec29c"><div class="ttname"><a href="a00824.html#ada31cc49cd6c9b760343ae21f7fec29c">ParseReserved</a></div><div class="ttdeci">ULONG ParseReserved(WCHAR *pchReserved, WCHAR *pchFind)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00906">queue.c:906</a></div></div>
<div class="ttc" id="aa02953_html_a5e6806726c901bac1a235d0caf8deb96"><div class="ttname"><a href="a02953.html#a5e6806726c901bac1a235d0caf8deb96">tagASYNCSENDMSG::lParam</a></div><div class="ttdeci">DWORD lParam</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02662">userk.h:2662</a></div></div>
<div class="ttc" id="aa00365_html_a177dce23f2b497ba8dc22f5a92d3f3d3"><div class="ttname"><a href="a00365.html#a177dce23f2b497ba8dc22f5a92d3f3d3">PTHREADINFO</a></div><div class="ttdeci">struct tagTHREADINFO * PTHREADINFO</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00762">user.h:762</a></div></div>
<div class="ttc" id="aa00629_html_a65cb65b2717949c25e662036c2ec1456"><div class="ttname"><a href="a00629.html#a65cb65b2717949c25e662036c2ec1456">_WOWCleanup</a></div><div class="ttdeci">VOID _WOWCleanup(HANDLE hInstance, DWORD hTaskWow, PNEMODULESEG SelList, DWORD nSel)</div><div class="ttdef"><b>Definition:</b> <a href="a00629_source.html#l00182">cleanup.c:182</a></div></div>
<div class="ttc" id="aa00872_html_a71170c4c5e4c60d4bc657fe52eb8d8d2"><div class="ttname"><a href="a00872.html#a71170c4c5e4c60d4bc657fe52eb8d8d2">xxxSetWindowPos</a></div><div class="ttdeci">BOOL xxxSetWindowPos(PWND pwnd, PWND pwndInsertAfter, int x, int y, int cx, int cy, UINT flags)</div><div class="ttdef"><b>Definition:</b> <a href="a00872_source.html#l01169">swp.c:1169</a></div></div>
<div class="ttc" id="aa00824_html_a3a58c2275b35d4e251d1d2801c54b477"><div class="ttname"><a href="a00824.html#a3a58c2275b35d4e251d1d2801c54b477">PtiFromThreadId</a></div><div class="ttdeci">PTHREADINFO PtiFromThreadId(DWORD dwThreadId)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03425">queue.c:3425</a></div></div>
<div class="ttc" id="aa02781_html_ae8e1aaf0b4027957c1918bcaf3d591dd"><div class="ttname"><a href="a02781.html#ae8e1aaf0b4027957c1918bcaf3d591dd">tagUSERSTARTUPINFO::dwYSize</a></div><div class="ttdeci">DWORD dwYSize</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01616">userk.h:1616</a></div></div>
<div class="ttc" id="aa02553_html_a9151e22fb7a09159687c55acdeb8be14"><div class="ttname"><a href="a02553.html#a9151e22fb7a09159687c55acdeb8be14">_HANDLEENTRY::pOwner</a></div><div class="ttdeci">PVOID pOwner</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01167">user.h:1167</a></div></div>
<div class="ttc" id="aa02869_html_a00f55b93fb49e91ab92e90fde747d716"><div class="ttname"><a href="a02869.html#a00f55b93fb49e91ab92e90fde747d716">tagQ::spwndActive</a></div><div class="ttdeci">PWND spwndActive</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02168">userk.h:2168</a></div></div>
<div class="ttc" id="aa00635_html_a5a00338a3147879f7fa0ecb4a938cd8c"><div class="ttname"><a href="a00635.html#a5a00338a3147879f7fa0ecb4a938cd8c">xxxDestroyWindow</a></div><div class="ttdeci">BOOL xxxDestroyWindow(PWND pwnd)</div><div class="ttdef"><b>Definition:</b> <a href="a00635_source.html#l01273">createw.c:1273</a></div></div>
<div class="ttc" id="aa03257_html_a106fec4487922d9baa52acc8bfee1c07"><div class="ttname"><a href="a03257.html#a106fec4487922d9baa52acc8bfee1c07">gpqCursor</a></div><div class="ttdeci">PQ gpqCursor</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00135">kernel/globals.c:135</a></div></div>
<div class="ttc" id="aa02857_html_acaac4c4abe64b478521a44ad7f1d692b"><div class="ttname"><a href="a02857.html#acaac4c4abe64b478521a44ad7f1d692b">tagQMSG::ExtraInfo</a></div><div class="ttdeci">LONG ExtraInfo</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02052">userk.h:2052</a></div></div>
<div class="ttc" id="aa00635_html_a4f173f306a71eba0d461cdcea18a804d"><div class="ttname"><a href="a00635.html#a4f173f306a71eba0d461cdcea18a804d">PatchThreadWindows</a></div><div class="ttdeci">VOID PatchThreadWindows(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00635_source.html#l02533">createw.c:2533</a></div></div>
<div class="ttc" id="aa02889_html_a09237cbbe78ba3aebf853599bced5ac8"><div class="ttname"><a href="a02889.html#a09237cbbe78ba3aebf853599bced5ac8">tagTHREADINFO::spklActive</a></div><div class="ttdeci">PKL spklActive</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02275">userk.h:2275</a></div></div>
<div class="ttc" id="aa00842_html_a69520c6e8309eb271485683d2bae262a"><div class="ttname"><a href="a00842.html#a69520c6e8309eb271485683d2bae262a">xxxProcessAsyncSendMessage</a></div><div class="ttdeci">VOID xxxProcessAsyncSendMessage(PASYNCSENDMSG pmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00842_source.html#l02852">sendmsg.c:2852</a></div></div>
<div class="ttc" id="aa02881_html_a0fac7dfac3f4208f91a3707ef2c25568"><div class="ttname"><a href="a02881.html#a0fac7dfac3f4208f91a3707ef2c25568">tagTDB::pwti</a></div><div class="ttdeci">PWOWTHREADINFO pwti</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02235">userk.h:2235</a></div></div>
<div class="ttc" id="aa03257_html_a400c45d213332277ff223c8c26996f88"><div class="ttname"><a href="a03257.html#a400c45d213332277ff223c8c26996f88">gafAsyncKeyState</a></div><div class="ttdeci">BYTE gafAsyncKeyState[CBKEYSTATE]</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00242">kernel/globals.c:242</a></div></div>
<div class="ttc" id="aa02869_html_aeb913440d6660cc91daeba2052f18f1f"><div class="ttname"><a href="a02869.html#aeb913440d6660cc91daeba2052f18f1f">tagQ::cLockCount</a></div><div class="ttdeci">USHORT cLockCount</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02190">userk.h:2190</a></div></div>
<div class="ttc" id="aa00644_html_a032fb1a6a955b0ec72e0412511d57ddc"><div class="ttname"><a href="a00644.html#a032fb1a6a955b0ec72e0412511d57ddc">DelayedDestroyCacheDC</a></div><div class="ttdeci">VOID DelayedDestroyCacheDC(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a00644_source.html#l01447">dc.c:1447</a></div></div>
<div class="ttc" id="aa02905_html_a4fd2d2e679634ec3858dace0c31526d1"><div class="ttname"><a href="a02905.html#a4fd2d2e679634ec3858dace0c31526d1">tagPROCESSINFO::bmDesktopHookFlags</a></div><div class="ttdeci">RTL_BITMAP bmDesktopHookFlags</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02411">userk.h:2411</a></div></div>
<div class="ttc" id="aa00365_html_a71c025f23da9f633f32d79fa661dac06"><div class="ttname"><a href="a00365.html#a71c025f23da9f633f32d79fa661dac06">CalcWakeMask</a></div><div class="ttdeci">UINT CalcWakeMask(UINT wMsgFilterMin, UINT wMsgFilterMax)</div><div class="ttdef"><b>Definition:</b> <a href="a03296_source.html#l00043">rtl/input.c:43</a></div></div>
<div class="ttc" id="aa02809_html_af2ad5f95e3f52f893a679de169114d40"><div class="ttname"><a href="a02809.html#af2ad5f95e3f52f893a679de169114d40">tagWINDOWSTATION::ptiClipLock</a></div><div class="ttdeci">PTHREADINFO ptiClipLock</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01767">userk.h:1767</a></div></div>
<div class="ttc" id="aa00824_html_af0277284ad14b2b685eb0dcb1f506323"><div class="ttname"><a href="a00824.html#af0277284ad14b2b685eb0dcb1f506323">GetAppCompatFlags</a></div><div class="ttdeci">DWORD GetAppCompatFlags(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00639">queue.c:639</a></div></div>
<div class="ttc" id="aa02649_html_ad7384d5f6cca06e0d245aaa350ba6e22"><div class="ttname"><a href="a02649.html#ad7384d5f6cca06e0d245aaa350ba6e22">tagCLIENTTHREADINFO::fsWakeBitsJournal</a></div><div class="ttdeci">WORD fsWakeBitsJournal</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l02219">user.h:2219</a></div></div>
<div class="ttc" id="aa00701_html_ad6d7e422abaf39b840b787b8f61dfd4e"><div class="ttname"><a href="a00701.html#ad6d7e422abaf39b840b787b8f61dfd4e">FreeThreadsWindowHooks</a></div><div class="ttdeci">VOID FreeThreadsWindowHooks(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a00701_source.html#l01798">hooks.c:1798</a></div></div>
<div class="ttc" id="aa02877_html_ad05024704e7271fbf8b5f26ccb1770fa"><div class="ttname"><a href="a02877.html#ad05024704e7271fbf8b5f26ccb1770fa">tagWOWTHREADINFO::idParentProcess</a></div><div class="ttdeci">DWORD idParentProcess</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02223">userk.h:2223</a></div></div>
<div class="ttc" id="aa03257_html_a248f55ad6c91324b37c63f5f471e0f13"><div class="ttname"><a href="a03257.html#a248f55ad6c91324b37c63f5f471e0f13">gptiShutdownNotify</a></div><div class="ttdeci">PTHREADINFO gptiShutdownNotify</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00129">kernel/globals.c:129</a></div></div>
<div class="ttc" id="aa02637_html_a502b41e3da09bf636e39a6394c466313"><div class="ttname"><a href="a02637.html#a502b41e3da09bf636e39a6394c466313">tagSBTRACK::spwndSB</a></div><div class="ttdeci">PWND spwndSB</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l02070">user.h:2070</a></div></div>
<div class="ttc" id="aa02877_html_aa366686f75ba96749398a5607305e2e3"><div class="ttname"><a href="a02877.html#aa366686f75ba96749398a5607305e2e3">tagWOWTHREADINFO::idTask</a></div><div class="ttdeci">DWORD idTask</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02221">userk.h:2221</a></div></div>
<div class="ttc" id="aa02781_html_abbaa6dbe87da7a3d8b7480a3136f8ca8"><div class="ttname"><a href="a02781.html#abbaa6dbe87da7a3d8b7480a3136f8ca8">tagUSERSTARTUPINFO::dwX</a></div><div class="ttdeci">DWORD dwX</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01613">userk.h:1613</a></div></div>
<div class="ttc" id="aa02553_html_ab51f0b363324b2cf09057a4c55d5100f"><div class="ttname"><a href="a02553.html#ab51f0b363324b2cf09057a4c55d5100f">_HANDLEENTRY::bType</a></div><div class="ttdeci">BYTE bType</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01168">user.h:1168</a></div></div>
<div class="ttc" id="aa00824_html_aeafdb7a2066a7b9a1c036e2db4ca0f35"><div class="ttname"><a href="a00824.html#aeafdb7a2066a7b9a1c036e2db4ca0f35">DestroyQueue</a></div><div class="ttdeci">void DestroyQueue(PQ pq, PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l01511">queue.c:1511</a></div></div>
<div class="ttc" id="aa03290_html_adc158fd691fd8f38a443ca9a299b1632"><div class="ttname"><a href="a03290.html#adc158fd691fd8f38a443ca9a299b1632">WakeInputIdle</a></div><div class="ttdeci">void WakeInputIdle(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l04904">kernel/input.c:4904</a></div></div>
<div class="ttc" id="aa00872_html_ac7afeeae4842cb12f6533b053ce72210"><div class="ttname"><a href="a00872.html#ac7afeeae4842cb12f6533b053ce72210">xxxProcessSetWindowPosEvent</a></div><div class="ttdeci">VOID xxxProcessSetWindowPosEvent(PSMWP psmwpT)</div><div class="ttdef"><b>Definition:</b> <a href="a00872_source.html#l01532">swp.c:1532</a></div></div>
<div class="ttc" id="aa02877_html_a6484bfbbd54183683e5c1547f9836377"><div class="ttname"><a href="a02877.html#a6484bfbbd54183683e5c1547f9836377">tagWOWTHREADINFO::idWaitObject</a></div><div class="ttdeci">DWORD idWaitObject</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02222">userk.h:2222</a></div></div>
<div class="ttc" id="aa00824_html_ad60baa8ce3236a522ca7ecc7d008e4a8"><div class="ttname"><a href="a00824.html#ad60baa8ce3236a522ca7ecc7d008e4a8">DebugValidateMLIST</a></div><div class="ttdeci">#define DebugValidateMLIST(pml)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00115">queue.c:115</a></div></div>
<div class="ttc" id="aa00656_html_a9612118d196f921acc52dcedded646c8"><div class="ttname"><a href="a00656.html#a9612118d196f921acc52dcedded646c8">_SetThreadDesktop</a></div><div class="ttdeci">BOOL _SetThreadDesktop(HDESK hdesk, PDESKTOP pdesk)</div><div class="ttdef"><b>Definition:</b> <a href="a00656_source.html#l02901">desktop.c:2901</a></div></div>
<div class="ttc" id="aa02901_html_a0152e70c5e5553e5908f9f08658f95c8"><div class="ttname"><a href="a02901.html#a0152e70c5e5553e5908f9f08658f95c8">tagDESKTOPVIEW::pdvNext</a></div><div class="ttdeci">struct tagDESKTOPVIEW * pdvNext</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02377">userk.h:2377</a></div></div>
<div class="ttc" id="aa00824_html_a3c0d1abafc858da62fb0fd6777a0d6aa"><div class="ttname"><a href="a00824.html#a3c0d1abafc858da62fb0fd6777a0d6aa">InitiateShutdown</a></div><div class="ttdeci">NTSTATUS InitiateShutdown(PETHREAD Thread, PULONG lpdwFlags)</div><div class="ttdef"><b>Definition:</b> <a href="a03236_source.html#l00068">kernel/exitwin.c:68</a></div></div>
<div class="ttc" id="aa00695_html_a5a81a8032897ec77f67bc27d7109b2d8"><div class="ttname"><a href="a00695.html#a5a81a8032897ec77f67bc27d7109b2d8">DestroyThreadsObjects</a></div><div class="ttdeci">VOID DestroyThreadsObjects()</div><div class="ttdef"><b>Definition:</b> <a href="a00695_source.html#l01597">handtabl.c:1597</a></div></div>
<div class="ttc" id="aa02889_html_abb1184e0c5805b5ad89b79dcc2bd17c8"><div class="ttname"><a href="a02889.html#abb1184e0c5805b5ad89b79dcc2bd17c8">tagTHREADINFO::rpdesk</a></div><div class="ttdeci">PDESKTOP rpdesk</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02288">userk.h:2288</a></div></div>
<div class="ttc" id="aa00635_html_af7f3962b7f9ad0874ead591af800fb79"><div class="ttname"><a href="a00635.html#af7f3962b7f9ad0874ead591af800fb79">xxxFreeWindow</a></div><div class="ttdeci">VOID xxxFreeWindow(PWND pwnd, PTL ptlpwndFree)</div><div class="ttdef"><b>Definition:</b> <a href="a00635_source.html#l01817">createw.c:1817</a></div></div>
<div class="ttc" id="aa03290_html_a555a50540fc3e5009b8d9262e0702592"><div class="ttname"><a href="a03290.html#a555a50540fc3e5009b8d9262e0702592">ReattachThreads</a></div><div class="ttdeci">BOOL ReattachThreads(BOOL fJournalAttach)</div><div class="ttdef"><b>Definition:</b> <a href="a03290_source.html#l05701">kernel/input.c:5701</a></div></div>
<div class="ttc" id="aa02889_html_aea8fcdf7513cfa8972ff27524296079b"><div class="ttname"><a href="a02889.html#aea8fcdf7513cfa8972ff27524296079b">tagTHREADINFO::pq</a></div><div class="ttdeci">struct tagQ * pq</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02273">userk.h:2273</a></div></div>
<div class="ttc" id="aa02889_html_a3c194fec8e59a3c52d6c3018cff46ae9"><div class="ttname"><a href="a02889.html#a3c194fec8e59a3c52d6c3018cff46ae9">tagTHREADINFO::hEventQueueClient</a></div><div class="ttdeci">HANDLE hEventQueueClient</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02283">userk.h:2283</a></div></div>
<div class="ttc" id="aa00824_html_ae1fd296dfef25f7afb5e44ece42b1bf3"><div class="ttname"><a href="a00824.html#ae1fd296dfef25f7afb5e44ece42b1bf3">xxxDestroyThreadInfo</a></div><div class="ttdeci">VOID xxxDestroyThreadInfo(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l01766">queue.c:1766</a></div></div>
<div class="ttc" id="aa02781_html_a256ccde56536d6a94ba1addb6b5ee6db"><div class="ttname"><a href="a02781.html#a256ccde56536d6a94ba1addb6b5ee6db">tagUSERSTARTUPINFO::dwY</a></div><div class="ttdeci">DWORD dwY</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01614">userk.h:1614</a></div></div>
<div class="ttc" id="aa02897_html"><div class="ttname"><a href="a02897.html">tagWOWPROCESSINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02362">userk.h:2362</a></div></div>
<div class="ttc" id="aa02889_html_a6f56a147ff76c3fc48c358f05adb0473"><div class="ttname"><a href="a02889.html#a6f56a147ff76c3fc48c358f05adb0473">tagTHREADINFO::pcti</a></div><div class="ttdeci">PCLIENTTHREADINFO pcti</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02280">userk.h:2280</a></div></div>
<div class="ttc" id="aa02857_html_a774eeae0f007ae3ea612baf38cd38936"><div class="ttname"><a href="a02857.html#a774eeae0f007ae3ea612baf38cd38936">tagQMSG::pti</a></div><div class="ttdeci">PTHREADINFO pti</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02054">userk.h:2054</a></div></div>
<div class="ttc" id="aa02897_html_a749a96ead00d6a048c45687a621b241e"><div class="ttname"><a href="a02897.html#a749a96ead00d6a048c45687a621b241e">tagWOWPROCESSINFO::pwpiNext</a></div><div class="ttdeci">struct tagWOWPROCESSINFO * pwpiNext</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02363">userk.h:2363</a></div></div>
<div class="ttc" id="aa03257_html_ab81554f3b7171b954e0f03e8d4202a38"><div class="ttname"><a href="a03257.html#ab81554f3b7171b954e0f03e8d4202a38">gHardErrorHandler</a></div><div class="ttdeci">HARDERRORHANDLER gHardErrorHandler</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00167">kernel/globals.c:167</a></div></div>
<div class="ttc" id="aa00899_html_ac2181d07596893ed44d18aa267ce4d23"><div class="ttname"><a href="a00899.html#ac2181d07596893ed44d18aa267ce4d23">LeaveCrit</a></div><div class="ttdeci">VOID LeaveCrit(VOID)</div></div>
<div class="ttc" id="aa02889_html_acb905cc16afd506363b5593dd0ad5dee"><div class="ttname"><a href="a02889.html#acb905cc16afd506363b5593dd0ad5dee">tagTHREADINFO::cEnterCount</a></div><div class="ttdeci">int cEnterCount</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02269">userk.h:2269</a></div></div>
<div class="ttc" id="aa03608_html_afd1a0e78d1f88954d93e48ab3821781f"><div class="ttname"><a href="a03608.html#afd1a0e78d1f88954d93e48ab3821781f">UINT</a></div><div class="ttdeci">typedef UINT(FAR WINAPI *MSGSOUNDPROC)()</div></div>
<div class="ttc" id="aa00824_html_a9fdadf9722ab6b6f80c2f840f95b2fd3"><div class="ttname"><a href="a00824.html#a9fdadf9722ab6b6f80c2f840f95b2fd3">xxxSleepThread</a></div><div class="ttdeci">BOOL xxxSleepThread(UINT fsWakeMask, DWORD Timeout, BOOL fInputIdle)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03096">queue.c:3096</a></div></div>
<div class="ttc" id="aa00824_html_a042c33a03ceecdea69466cb1d0e916e7"><div class="ttname"><a href="a00824.html#a042c33a03ceecdea69466cb1d0e916e7">xxxPollAndWaitForSingleObject</a></div><div class="ttdeci">DWORD xxxPollAndWaitForSingleObject(PKEVENT pEvent, PVOID pExecObject, DWORD dwMilliseconds)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l04050">queue.c:4050</a></div></div>
<div class="ttc" id="aa02905_html_a13681ea80665f84dc0d89cce4e6e1b81"><div class="ttname"><a href="a02905.html#a13681ea80665f84dc0d89cce4e6e1b81">tagPROCESSINFO::pdvList</a></div><div class="ttdeci">PDESKTOPVIEW pdvList</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02409">userk.h:2409</a></div></div>
<div class="ttc" id="aa02857_html_ac4e11a54fcd4eb693fc0c04630804f67"><div class="ttname"><a href="a02857.html#ac4e11a54fcd4eb693fc0c04630804f67">tagQMSG::dwQEvent</a></div><div class="ttdeci">DWORD dwQEvent</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02053">userk.h:2053</a></div></div>
<div class="ttc" id="aa02889_html_acb32ba9beb876baf218e65f524d10b17"><div class="ttname"><a href="a02889.html#acb32ba9beb876baf218e65f524d10b17">tagTHREADINFO::cWindows</a></div><div class="ttdeci">UINT cWindows</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02324">userk.h:2324</a></div></div>
<div class="ttc" id="aa00365_html_abce9368ed5b93dc4c0e3e9cc7c99157b"><div class="ttname"><a href="a00365.html#abce9368ed5b93dc4c0e3e9cc7c99157b">PETHREAD</a></div><div class="ttdeci">struct _ETHREAD * PETHREAD</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00060">user.h:60</a></div></div>
<div class="ttc" id="aa00824_html_ada8a7fdcaa372258461349002764851c"><div class="ttname"><a href="a00824.html#ada8a7fdcaa372258461349002764851c">gpwpCalcFirst</a></div><div class="ttdeci">PW32PROCESS gpwpCalcFirst</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l00028">queue.c:28</a></div></div>
<div class="ttc" id="aa02857_html_ae10093b6e4748c1e5b22536acccde083"><div class="ttname"><a href="a02857.html#ae10093b6e4748c1e5b22536acccde083">tagQMSG::pqmsgNext</a></div><div class="ttdeci">struct tagQMSG * pqmsgNext</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02049">userk.h:2049</a></div></div>
<div class="ttc" id="aa02889_html_a908f89e143de49ad52495f21d8231d8a"><div class="ttname"><a href="a02889.html#a908f89e143de49ad52495f21d8231d8a">tagTHREADINFO::idLast</a></div><div class="ttdeci">DWORD idLast</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02304">userk.h:2304</a></div></div>
<div class="ttc" id="aa00824_html_a5f74500e03b484ebab534e6cc8513b6f"><div class="ttname"><a href="a00824.html#a5f74500e03b484ebab534e6cc8513b6f">InitQEntryLookaside</a></div><div class="ttdeci">NTSTATUS InitQEntryLookaside()</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02227">queue.c:2227</a></div></div>
<div class="ttc" id="aa02477_html_ac18617bb8bdbcb8e9c73e759b9df75eb"><div class="ttname"><a href="a02477.html#ac18617bb8bdbcb8e9c73e759b9df75eb">_CLIENTINFO::dwExpWinVer</a></div><div class="ttdeci">DWORD dwExpWinVer</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00376">user.h:376</a></div></div>
<div class="ttc" id="aa02521_html_aba571224616f70b9a072015bc9873676"><div class="ttname"><a href="a02521.html#aba571224616f70b9a072015bc9873676">tagSHAREDINFO::aheList</a></div><div class="ttdeci">struct _HANDLEENTRY * aheList</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01060">user.h:1060</a></div></div>
<div class="ttc" id="aa02609_html_a68937d60a6f49b7a8431db62b38ea721"><div class="ttname"><a href="a02609.html#a68937d60a6f49b7a8431db62b38ea721">tagDESKTOPINFO::spwnd</a></div><div class="ttdeci">struct tagWND * spwnd</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l01603">user.h:1603</a></div></div>
<div class="ttc" id="aa00371_html_adbdd8355d15a97b6f3a9e4766e6a2cc1"><div class="ttname"><a href="a00371.html#adbdd8355d15a97b6f3a9e4766e6a2cc1">RIPERR1</a></div><div class="ttdeci">#define RIPERR1(idErr, flags, szFmt, p1)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00120">winerrp.h:120</a></div></div>
<div class="ttc" id="aa00824_html_abe5d732b18e62463d43e6a45fa2bd9b1"><div class="ttname"><a href="a00824.html#abe5d732b18e62463d43e6a45fa2bd9b1">CheckRemoveHotkeyBit</a></div><div class="ttdeci">void CheckRemoveHotkeyBit(PTHREADINFO pti, PMLIST pml)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02403">queue.c:2403</a></div></div>
<div class="ttc" id="aa03188_html_af647df0fd7600605c1c70baf5ad7540a"><div class="ttname"><a href="a03188.html#af647df0fd7600605c1c70baf5ad7540a">xxxDDETrackGetMessageHook</a></div><div class="ttdeci">VOID xxxDDETrackGetMessageHook(PMSG pmsg)</div><div class="ttdoc">xxxDDETrackGetMessageHook</div><div class="ttdef"><b>Definition:</b> <a href="a03188_source.html#l00553">kernel/ddetrack.c:553</a></div></div>
<div class="ttc" id="aa02889_html"><div class="ttname"><a href="a02889.html">tagTHREADINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02260">userk.h:2260</a></div></div>
<div class="ttc" id="aa00371_html_a906cb0845450a5d5422ce513ecd8a32f"><div class="ttname"><a href="a00371.html#a906cb0845450a5d5422ce513ecd8a32f">RIPMSG2</a></div><div class="ttdeci">#define RIPMSG2(flags, szFmt, p1, p2)</div><div class="ttdef"><b>Definition:</b> <a href="a00371_source.html#l00133">winerrp.h:133</a></div></div>
<div class="ttc" id="aa02905_html_a612848a41faf6b99a0532dc84d375727"><div class="ttname"><a href="a02905.html#a612848a41faf6b99a0532dc84d375727">tagPROCESSINFO::cThreads</a></div><div class="ttdeci">int cThreads</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02391">userk.h:2391</a></div></div>
<div class="ttc" id="aa00899_html_ad4e381baf70be5194cad4fa801e36b80"><div class="ttname"><a href="a00899.html#ad4e381baf70be5194cad4fa801e36b80">PWOWTHREADINFO</a></div><div class="ttdeci">struct tagWOWTHREADINFO * PWOWTHREADINFO</div></div>
<div class="ttc" id="aa03257_html_a326757fcfe334f2ffd59d64d4645d37a"><div class="ttname"><a href="a03257.html#a326757fcfe334f2ffd59d64d4645d37a">grpdeskRitInput</a></div><div class="ttdeci">PDESKTOP grpdeskRitInput</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00187">kernel/globals.c:187</a></div></div>
<div class="ttc" id="aa02477_html"><div class="ttname"><a href="a02477.html">_CLIENTINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00372">user.h:372</a></div></div>
<div class="ttc" id="aa02885_html_ac80253c995012ace1d1b53174231ca28"><div class="ttname"><a href="a02885.html#ac80253c995012ace1d1b53174231ca28">tagMENUSTATE::ptiMenuStateOwner</a></div><div class="ttdeci">struct tagTHREADINFO * ptiMenuStateOwner</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02252">userk.h:2252</a></div></div>
<div class="ttc" id="aa02877_html"><div class="ttname"><a href="a02877.html">tagWOWTHREADINFO</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02219">userk.h:2219</a></div></div>
<div class="ttc" id="aa03257_html_a95e7b47e56cc8a6f2644aa5c6d3acc68"><div class="ttname"><a href="a03257.html#a95e7b47e56cc8a6f2644aa5c6d3acc68">gpwpiFirstWow</a></div><div class="ttdeci">PWOWPROCESSINFO gpwpiFirstWow</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00140">kernel/globals.c:140</a></div></div>
<div class="ttc" id="aa02889_html_a3f4ef466a82433ef538cc8a35f4d0907"><div class="ttname"><a href="a02889.html#a3f4ef466a82433ef538cc8a35f4d0907">tagTHREADINFO::fsChangeBitsRemoved</a></div><div class="ttdeci">USHORT fsChangeBitsRemoved</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02277">userk.h:2277</a></div></div>
<div class="ttc" id="aa02653_html_a68937d60a6f49b7a8431db62b38ea721"><div class="ttname"><a href="a02653.html#a68937d60a6f49b7a8431db62b38ea721">tagCARET::spwnd</a></div><div class="ttdeci">struct tagWND * spwnd</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l02239">user.h:2239</a></div></div>
<div class="ttc" id="aa02889_html_a64e1dadbca00e671a6b925590f57e268"><div class="ttname"><a href="a02889.html#a64e1dadbca00e671a6b925590f57e268">tagTHREADINFO::mlPost</a></div><div class="ttdeci">MLIST mlPost</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02276">userk.h:2276</a></div></div>
<div class="ttc" id="aa02889_html_ac18617bb8bdbcb8e9c73e759b9df75eb"><div class="ttname"><a href="a02889.html#ac18617bb8bdbcb8e9c73e759b9df75eb">tagTHREADINFO::dwExpWinVer</a></div><div class="ttdeci">DWORD dwExpWinVer</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02321">userk.h:2321</a></div></div>
<div class="ttc" id="aa00680_html_a297222c1c05315b3b86e418aebd79748"><div class="ttname"><a href="a00680.html#a297222c1c05315b3b86e418aebd79748">GetProcessLuid</a></div><div class="ttdeci">NTSTATUS GetProcessLuid(PETHREAD Thread, PLUID LuidProcess)</div><div class="ttdef"><b>Definition:</b> <a href="a00680_source.html#l00061">ex.c:61</a></div></div>
<div class="ttc" id="aa00035_html_a53b9632eb283c87e1b7ac76a5408de7e"><div class="ttname"><a href="a00035.html#a53b9632eb283c87e1b7ac76a5408de7e">ClientThreadSetup</a></div><div class="ttdeci">BOOL ClientThreadSetup(VOID)</div><div class="ttdef"><b>Definition:</b> <a href="a00035_source.html#l00749">clinit.c:749</a></div></div>
<div class="ttc" id="aa02889_html_a82665c77f0395ea674ade3c7a96bd9d1"><div class="ttname"><a href="a02889.html#a82665c77f0395ea674ade3c7a96bd9d1">tagTHREADINFO::ptLast</a></div><div class="ttdeci">POINT ptLast</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02303">userk.h:2303</a></div></div>
<div class="ttc" id="aa02905_html_a2306374fe9d8ff9df10b4a7491946258"><div class="ttname"><a href="a02905.html#a2306374fe9d8ff9df10b4a7491946258">tagPROCESSINFO::ppiNext</a></div><div class="ttdeci">PPROCESSINFO ppiNext</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02389">userk.h:2389</a></div></div>
<div class="ttc" id="aa00899_html_adc99299add8f7128f863256c6901cf41"><div class="ttname"><a href="a00899.html#adc99299add8f7128f863256c6901cf41">CheckPtiSysPeek</a></div><div class="ttdeci">void CheckPtiSysPeek(int where, PQ pq, DWORD newIdSysPeek)</div></div>
<div class="ttc" id="aa00686_html_a32ce9762c0f32576f47ce0d6bc239f04"><div class="ttname"><a href="a00686.html#a32ce9762c0f32576f47ce0d6bc239f04">xxxDeactivate</a></div><div class="ttdeci">void xxxDeactivate(PTHREADINFO pti, DWORD tidSetForeground)</div><div class="ttdef"><b>Definition:</b> <a href="a00686_source.html#l00037">focusact.c:37</a></div></div>
<div class="ttc" id="aa03257_html_af01477af415dcb7442680606f63b5e29"><div class="ttname"><a href="a03257.html#af01477af415dcb7442680606f63b5e29">gppiStarting</a></div><div class="ttdeci">PPROCESSINFO gppiStarting</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00138">kernel/globals.c:138</a></div></div>
<div class="ttc" id="aa00365_html_ae68d35bd0e63af682f3d29bf9a03a2f4"><div class="ttname"><a href="a00365.html#ae68d35bd0e63af682f3d29bf9a03a2f4">PPROCESSINFO</a></div><div class="ttdeci">struct tagPROCESSINFO * PPROCESSINFO</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00763">user.h:763</a></div></div>
<div class="ttc" id="aa00824_html_a1edc88fad519f1c6daaf9b6b2a6f8b65"><div class="ttname"><a href="a00824.html#a1edc88fad519f1c6daaf9b6b2a6f8b65">xxxMsgWaitForMultipleObjects</a></div><div class="ttdeci">DWORD xxxMsgWaitForMultipleObjects(DWORD nCount, PVOID *apObjects, BOOL fWaitAll, DWORD dwMilliseconds, DWORD dwWakeMask, MSGWAITCALLBACK pfnNonMsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02966">queue.c:2966</a></div></div>
<div class="ttc" id="aa00020_html_ad760da1dd81d9e84dee607d18edfde39"><div class="ttname"><a href="a00020.html#ad760da1dd81d9e84dee607d18edfde39">gpsi</a></div><div class="ttdeci">PSERVERINFO gpsi</div><div class="ttdef"><b>Definition:</b> <a href="a00020_source.html#l00039">clglobal.c:39</a></div></div>
<div class="ttc" id="aa03257_html_a0505c3ff32d34e510caf737f5fb72826"><div class="ttname"><a href="a03257.html#a0505c3ff32d34e510caf737f5fb72826">gcSysExpunge</a></div><div class="ttdeci">DWORD gcSysExpunge</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00180">kernel/globals.c:180</a></div></div>
<div class="ttc" id="aa00719_html_a6fbaa4f2c3cf36d69c0400f1413ac858"><div class="ttname"><a href="a00719.html#a6fbaa4f2c3cf36d69c0400f1413ac858">xxxAddFontResourceW</a></div><div class="ttdeci">int xxxAddFontResourceW(LPWSTR lpFile, FLONG flags)</div><div class="ttdef"><b>Definition:</b> <a href="a00719_source.html#l00109">init.c:109</a></div></div>
<div class="ttc" id="aa00824_html_a40077ba7267f3c31f389f3eeac9c4506"><div class="ttname"><a href="a00824.html#a40077ba7267f3c31f389f3eeac9c4506">StoreQMessage</a></div><div class="ttdeci">void StoreQMessage(PQMSG pqmsg, PWND pwnd, UINT message, DWORD wParam, LONG lParam, DWORD dwQEvent, DWORD dwExtraInfo)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l03502">queue.c:3502</a></div></div>
<div class="ttc" id="aa03257_html_a8534ae64a3a0d32b8727b62158bd1d34"><div class="ttname"><a href="a03257.html#a8534ae64a3a0d32b8727b62158bd1d34">gspwndInternalCapture</a></div><div class="ttdeci">PWND gspwndInternalCapture</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00075">kernel/globals.c:75</a></div></div>
<div class="ttc" id="aa02905_html_af72a4da82fac27fa09d21912668e92cb"><div class="ttname"><a href="a02905.html#af72a4da82fac27fa09d21912668e92cb">tagPROCESSINFO::luidSession</a></div><div class="ttdeci">LUID luidSession</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02408">userk.h:2408</a></div></div>
<div class="ttc" id="aa02477_html_a2f8155c1da5bc6033b5fb9682e01fab6"><div class="ttname"><a href="a02477.html#a2f8155c1da5bc6033b5fb9682e01fab6">_CLIENTINFO::CodePage</a></div><div class="ttdeci">WORD CodePage</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l00394">user.h:394</a></div></div>
<div class="ttc" id="aa02869_html_af0a73901f2264cfe048d588810333935"><div class="ttname"><a href="a02869.html#af0a73901f2264cfe048d588810333935">tagQ::spwndAltTab</a></div><div class="ttdeci">PWND spwndAltTab</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02180">userk.h:2180</a></div></div>
<div class="ttc" id="aa00899_html_a792b9004a4d313da382f9a9fd8b5c1aa"><div class="ttname"><a href="a00899.html#a792b9004a4d313da382f9a9fd8b5c1aa">_GetProcessWindowStation</a></div><div class="ttdeci">PWINDOWSTATION _GetProcessWindowStation(HWINSTA *)</div><div class="ttdef"><b>Definition:</b> <a href="a00920_source.html#l00891">winsta.c:891</a></div></div>
<div class="ttc" id="aa00899_html_a77006252d3c3006452d5dc2272d7cc9a"><div class="ttname"><a href="a00899.html#a77006252d3c3006452d5dc2272d7cc9a">USERSTARTUPINFO</a></div><div class="ttdeci">struct tagUSERSTARTUPINFO USERSTARTUPINFO</div></div>
<div class="ttc" id="aa02781_html_a9ed6a30359da8299f730bdf76bc44dbb"><div class="ttname"><a href="a02781.html#a9ed6a30359da8299f730bdf76bc44dbb">tagUSERSTARTUPINFO::cb</a></div><div class="ttdeci">DWORD cb</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01612">userk.h:1612</a></div></div>
<div class="ttc" id="aa02649_html_aa1082b32678ff0e6f4d076c83458e1ca"><div class="ttname"><a href="a02649.html#aa1082b32678ff0e6f4d076c83458e1ca">tagCLIENTTHREADINFO::fsWakeMask</a></div><div class="ttdeci">WORD fsWakeMask</div><div class="ttdef"><b>Definition:</b> <a href="a00365_source.html#l02220">user.h:2220</a></div></div>
<div class="ttc" id="aa02869_html_acaac4c4abe64b478521a44ad7f1d692b"><div class="ttname"><a href="a02869.html#acaac4c4abe64b478521a44ad7f1d692b">tagQ::ExtraInfo</a></div><div class="ttdeci">LONG ExtraInfo</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02194">userk.h:2194</a></div></div>
<div class="ttc" id="aa02869_html"><div class="ttname"><a href="a02869.html">tagQ</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02156">userk.h:2156</a></div></div>
<div class="ttc" id="aa03257_html_ae6141080cfca7976a545c46fa30d5401"><div class="ttname"><a href="a03257.html#ae6141080cfca7976a545c46fa30d5401">gdwSysExpungeMask</a></div><div class="ttdeci">DWORD gdwSysExpungeMask</div><div class="ttdef"><b>Definition:</b> <a href="a03257_source.html#l00179">kernel/globals.c:179</a></div></div>
<div class="ttc" id="aa02801_html_aec6cab8a48f05b1fd77850a34109675e"><div class="ttname"><a href="a02801.html#aec6cab8a48f05b1fd77850a34109675e">tagDESKTOP::rpwinstaParent</a></div><div class="ttdeci">struct tagWINDOWSTATION * rpwinstaParent</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l01710">userk.h:1710</a></div></div>
<div class="ttc" id="aa02865_html_ad289943e39576dd5ba38e1fef83da6c9"><div class="ttname"><a href="a02865.html#ad289943e39576dd5ba38e1fef83da6c9">tagMLIST::pqmsgRead</a></div><div class="ttdeci">PQMSG pqmsgRead</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02148">userk.h:2148</a></div></div>
<div class="ttc" id="aa02857_html"><div class="ttname"><a href="a02857.html">tagQMSG</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02048">userk.h:2048</a></div></div>
<div class="ttc" id="aa00701_html_a4a596c02b66f7f049c18711b882e0b89"><div class="ttname"><a href="a00701.html#a4a596c02b66f7f049c18711b882e0b89">xxxCallHook</a></div><div class="ttdeci">int xxxCallHook(int nCode, DWORD wParam, DWORD lParam, int iHook)</div><div class="ttdef"><b>Definition:</b> <a href="a00701_source.html#l00954">hooks.c:954</a></div></div>
<div class="ttc" id="aa00638_html_a439658ba5849cd209ffc346d05cb508b"><div class="ttname"><a href="a00638.html#a439658ba5849cd209ffc346d05cb508b">LockQCursor</a></div><div class="ttdeci">PCURSOR LockQCursor(PQ pq, PCURSOR pcur)</div><div class="ttdef"><b>Definition:</b> <a href="a00638_source.html#l00605">cursor.c:605</a></div></div>
<div class="ttc" id="aa00824_html_a73f8ccc884e465b0ab2f729c70791cc1"><div class="ttname"><a href="a00824.html#a73f8ccc884e465b0ab2f729c70791cc1">DeleteThreadInfo</a></div><div class="ttdeci">VOID DeleteThreadInfo(PTHREADINFO pti)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l01693">queue.c:1693</a></div></div>
<div class="ttc" id="aa02885_html"><div class="ttname"><a href="a02885.html">tagMENUSTATE</a></div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02242">userk.h:2242</a></div></div>
<div class="ttc" id="aa00824_html_a84f045ca9aa55af0b0979f00d052cca1"><div class="ttname"><a href="a00824.html#a84f045ca9aa55af0b0979f00d052cca1">INTERMEDIATE_TIMEOUT</a></div><div class="ttdeci">#define INTERMEDIATE_TIMEOUT</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l04032">queue.c:4032</a></div></div>
<div class="ttc" id="aa02889_html_a09679d30cfd8c200ad9b8352eb155126"><div class="ttname"><a href="a02889.html#a09679d30cfd8c200ad9b8352eb155126">tagTHREADINFO::cQuit</a></div><div class="ttdeci">int cQuit</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02306">userk.h:2306</a></div></div>
<div class="ttc" id="aa00824_html_ae4353c386ec9e86fd65fde7125ecabb0"><div class="ttname"><a href="a00824.html#ae4353c386ec9e86fd65fde7125ecabb0">DelQEntry</a></div><div class="ttdeci">void DelQEntry(PMLIST pml, PQMSG pqmsg)</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02313">queue.c:2313</a></div></div>
<div class="ttc" id="aa02857_html_a13aa0c37bd6a6afb5a5386b5946b36b5"><div class="ttname"><a href="a02857.html#a13aa0c37bd6a6afb5a5386b5946b36b5">tagQMSG::pqmsgPrev</a></div><div class="ttdeci">struct tagQMSG * pqmsgPrev</div><div class="ttdef"><b>Definition:</b> <a href="a00899_source.html#l02050">userk.h:2050</a></div></div>
<div class="ttc" id="aa00824_html_a24c1969f4f02b8e86ffabb0c86f94851"><div class="ttname"><a href="a00824.html#a24c1969f4f02b8e86ffabb0c86f94851">QS_TEST</a></div><div class="ttdeci">#define QS_TEST</div><div class="ttdef"><b>Definition:</b> <a href="a00824_source.html#l02899">queue.c:2899</a></div></div>
<!-- start footer part -->
<div id="nav-path" class="navpath"><!-- id is needed for treeview function! -->
  <ul>
    <li class="navelem"><a class="el" href="dir_885cc87fac2d91e269af0a5a959fa5f6.html">E:</a></li><li class="navelem"><a class="el" href="dir_4e091ed8704426a7a4980368ba259fde.html">git</a></li><li class="navelem"><a class="el" href="dir_cd70cb5eb491250157f2d55d3ff4b13e.html">backup</a></li><li class="navelem"><a class="el" href="dir_ba2b673b566ba104b956abdc6dec0552.html">org</a></li><li class="navelem"><a class="el" href="dir_5bb0003d7907b45051943541418399f5.html">ntuser</a></li><li class="navelem"><a class="el" href="dir_2a0a56546b70a0973705719e6a88eab3.html">kernel</a></li><li class="navelem"><a class="el" href="a00824.html">queue.c</a></li>
    <li class="footer">制作者
    <a href="http://www.doxygen.org/index.html">
    <img class="footer" src="doxygen.png" alt="doxygen"/></a> 1.8.17 </li>
  </ul>
</div>
</body>
</html>
